I have a public CLR property defined in the code outside the WPF window. This property has only a specific setter.
public SomeCustomType SomeProperty {
set {
someValue = value;
}
}
I also have a ComboBox defined in the XAML of this WPF window. This ComboBox has two ComboBoxItem objects. The properties of the contents of the ComboBoxItem objects are set to the text that I want to display for these elements. The properties of the ComboBoxItem object tag are set to the static CLR property in another class. SelectedValuePath is set to Tag on the ComboBox. I have a SelectedValue property associated with the Window CLR property, with the mode set to OneWayToSource, and UpdateSourceTrigger set to PropertyChanged.
<ComboBox SelectedValue="{Binding Registry, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}" SelectedValuePath="Tag" SelectedIndex="0">
<ComboBoxItem Content="Item1" Tag={x:Static someNamespace:SomeType.SomeStaticCLRProperty}" />
<ComboBoxItem Content="Item1" Tag={x:Static someNamespace:SomeType.SomeStaticCLRProperty}" />
</ComboBox>
, : ComboBox, CLR . , - ComboBox.
, : " Property Get ". , , , , Window CLR. , .
- ?
!
EDIT: , , , . , ( ) null. , . ?