Answers for "wpf binding visibility to property"

C#
0

wpf binding visibility to property

///<!-- in AXML-->
<Grid x:Name="ShowError" Visibility="{Binding VisibleState}">



////In CODE

      public Visibility VisibleState
      {
          get { return _VisibleState; }
          set
          {
              if (_VisibleState != value)
              {
                  _VisibleState = value;
                  OnPropertyChanged( "VisibleState" );
              }
          }
      }
      private Visibility _VisibleState = Visibility.Hidden;

  public void SetVisibility( bool visible )
  {
    if (visible)
      VisibleState = System.Windows.Visibility.Visible;
    else
      VisibleState = System.Windows.Visibility.Collapsed;
  }
Posted by: Guest on December-02-2020

Code answers related to "wpf binding visibility to property"

C# Answers by Framework

Browse Popular Code Answers by Language