Hi guys , I have a picker and button .I want to set button visibilty after picker selected. Seems like OnSelectedChanged action of picker can not be bind to a command . i have already binding for SelectedItem property so i thought i can use this for make button visible. It is working but there is a problem : Button visibilty doesnt changing after picker first selection time. After 1. selection if i select other thing on picker it is changing.
This is my code :
// MVVM part
public bool IsLevelSelected {
get { return _isLevelSelected; }
set
{
_isLevelSelected = value;
OnPropertyChanged(nameof(IsLevelSelected));
}
}
public string SelectedLevel
{
get
{
return _selectedLevel;
}
set
{
IsLevelSelected = true;
_selectedLevel = value;
OnPropertyChanged(nameof(SelectedLevel));
}
}
//XAML
<Picker x:Name="picker" Title="Seviye seçiniz" FontAttributes="Bold" FontSize="Large" Margin="0,50,0,0"
SelectedItem="{Binding SelectedLevel}" HorizontalOptions=" >
<Button Text="{Binding SelectedLevel,StringFormat='{0}. Leveli Başlat'}" d:Text="1.ci Leveli Başlat"
Command="{Binding StartGame}"
HeightRequest="100" Margin="20,40,20,20"
BorderWidth="5" BackgroundColor="DarkKhaki"
IsVisible="{Binding IsLevelSelected}"
CornerRadius="25" CommandParameter="{Binding SelectedLevel}"