I have a StackPanel of basic input controls. Some combinations selections are invalid. I would like to recompute the "form"s validation every time one of the inputs change. Is there some kind of event you can listen to on the parent control that will trigger when ever an observable property changes on a child?
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<RadioButtons Header="Options:">
<RadioButton Content="Option 1"/>
<RadioButton Content="Option 2"/>
</RadioButtons>
<ToggleSwitch OnContent="On" OffContent="Off"/>
<ComboBox>
<ComboBoxItem Content="Item 1"/>
<ComboBoxItem Content="Item 2"/>
</ComboBox>
</StackPanel>
It is recommended to use Data Binding to listen the selection change of the controls. In Data Binding, use Binding.Mode
TwoWaybindings, changes to the target will automatically propagate to the source.Define a class which inherits INotifyPropertyChanged, and recompute the "form"s validation in the PropertyChanged event.
Page.xaml
Page.xaml.cs