So, let's say I have an MVVM application , and I want the user to populate the TextBox, and while he is filling it , I want to check if he has typed the client’s last name .
Here's how I can get ViewModel to know when a user changed an item in a ComboBox :
<ComboBox
ItemsSource="{Binding Customers}"
ItemTemplate="{StaticResource CustomerComboBoxTemplate}"
Margin="20"
HorizontalAlignment="Left"
SelectedItem="{Binding SelectedCustomer, Mode=TwoWay}"/>
And here is how I can get the ViewModel to know when the user moves the slider :
<Slider Minimum="0"
Margin="10"
Width="400"
IsSnapToTickEnabled="True"
Maximum="{Binding HighestCustomerIndex, Mode=TwoWay}"
Value="{Binding SelectedCustomerIndex, Mode=TwoWay}"/>
And here is how I can get the ViewModel to know when the user has the changed text in the TextBox and removed the focus from the TextBox:
<TextBox
Width="200"
Text="{Binding TypedCustomerName}"/>
ViewModel, , TextBox, , . - :
PSEUDO-CODE ( , TextChanged ):
<TextBox
Width="200"
TextChanged="{Binding CurrentTextInTextBox}"/>