I am trying to do something similar to Binding to static class property. I want to bind the IsVisible property of multiple controls to a single static bool (so I can make them all appear and disappear with a single C# statement).
Here is my XAML for one of the controls:
<Label Grid.Row="3"
x:Name="LabelDireWarning"
Grid.ColumnSpan="2"
TextColor="Red"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
IsVisible="{Binding Source={x:Static local:State.IsChangingPassword}}"
Text="blah blah."/>
Here is the field:
public static class State
{
public static bool IsChangingPassword = true;
etc.
I have a test button that toggles IsChangingPassword
, but the visibility of the control does not change.
I guess this has to do with "the raising of the PropertyChanged
event," but what should I to do?