How to use SelectedIndexChanged or CommandParameter with CommunityToolkit.Mvvm
I am using CommunityToolkit.Mvvm with ObservableObject
and ObservableProperty
. In the MVVM pattern, how can I trigger the SelectedIndexChanged
event for a Picker when an item is selected, or handle changes in an Entry when typing into the textbox?
[RelayCommand]
private void OnChanged()
{
}
<Picker TitleColor="{StaticResource LabelPlaceHolder}"
ItemsSource="{Binding Countrys}"
ItemDisplayBinding="{Binding Name}"
SelectedItem="{Binding SelectedItemCountry,Mode=TwoWay}"
SelectedIndexChanged="{Binding OnChanged}"
FontFamily="OpenSansSemibold"
FontSize="12">