How can I set the selected property in a custom user control which inherits XAML ComboBox?

Found the problem. The window constructor happens BEFORE the YesNoComboBox_Loaded. By setting the selected value before the combobox actually has values, for some reason it can only select the first item (try inverting the way you add the KeyValuePairs and set the SelectedValue to false, then try true.

False will work, true won't). I also tried doing it in the Window_Loaded event, but Window_Loaded also happens before YesNoComboBox_Loaded. So what you need to do is add the KeyValuePair items in the constructor of your combobox, and then set the selected value in Window_Loaded (since window constructor ALSO happens before your combobox constructor).

Here's the code.

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