Hi,
I want to disable a button when SelectedItem property of ListView is null. I tried this:
<Button Clicked="myButton_Clicked" Image="ic_image" x:Name="myButton">
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=myListView, Path=SelectedItem}" Value="{x:Null}">
<Setter Property="IsEnabled" Value="false" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
The app has a login page and a main page. Login credentials are stored on the device. If everything goes well, main page appears otherwise login page appears.
If I comment out this part:
...
<DataTrigger Binding="{Binding ElementName=myListView, Path=SelectedItem}" Value="{x:Null}">
<Setter Property="IsEnabled" Value="false" />
</DataTrigger>
...
main page appears but if I uncomment that part, login page appears. I think that part causes an error but the IDE (VS Mac) doesn't throw it. Could anyone help me?
Thank you...