<ToggleButton x:Name="tbtnTest" IsThreeState="True" Indeterminate="tbtnTest_Indeterminate" Checked="tbtnTest_Checked" Unchecked="tbtnTest_Unchecked" Canvas.Top="60" Canvas.Left="30" Content="Change state"/>
Code behind (C#):
private void tbtnTest_Checked( object sender, RoutedEventArgs e )
{
this.tblText.Text = "Checked";
}
private void tbtnTest_Unchecked( object sender, RoutedEventArgs e )
{
this.tblText.Text = "Unchecked";
}
private void tbtnTest_Indeterminate( object sender, RoutedEventArgs e )
{
this.tblText.Text = "Indetermined";
}
No comments:
Post a Comment