WPF ListBoxItem selection problem?

To begin with, put the content outside the CheckBox.

To begin with, put the content outside the CheckBox: After that, you will need to ensure that pressing space on a ListBoxItem results in the CheckBox being checked. There are a number of ways of doing this, including a simple event handler on the ListBoxItem. Or you could specify a handler for UIElement.

KeyUp or whatever in your DataTemplate.

You can also bind the IsChecked property of the CheckBox and IsSelected property of the ListBoxItem.

That's the way I had it at first. The flaw is that that the checkbox states are bound to the list control selection state, which is not normal behavior for a list control containing checkboxes. – 17 of 26 Sep 25 '08 at 17:26.

In your use case it would be way simpler to use a ItemsControl instead of a list box. Simply switching to ItemsControl will give you exactly what you need: You can click on text to check checkboxes (default behavior) and you can use the keyboard too without having to wire up any event handlers.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions