Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you need to do is implement <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx" rel="nofollow">INotifyPropertyChanged</a> in your <code>ViewModel</code>: </p> <pre><code>public class YourViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string propertyName) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(propertyName)); } } public void ShowThePanel() { PanelVisibility = Visibility.Visible; } private Visibility panelVisibility; public Visibility PanelVisibility { get { return panelVisibility } set { panelVisibility = value; OnPropertyChanged("PanelVisibility"); } } } </code></pre> <p>Then in your <code>XAML</code>:</p> <pre><code>&lt;StackPanel Visibility="{Binding Path=PanelVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /&gt; </code></pre> <p>EDIT:</p> <blockquote> <p>The INotifyPropertyChanged interface is used to notify clients, typically binding clients, that a property value has changed. For example, consider a Person object with a property called FirstName. To provide generic property-change notification, the Person type implements the INotifyPropertyChanged interface and raises a <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.propertychanged.aspx" rel="nofollow">PropertyChanged</a> event when FirstName is changed. For change notification to occur in a binding between a bound client and a data source, your bound type should either: </p> <ul> <li>Implement the INotifyPropertyChanged interface (preferred). </li> <li>Provide a change event for each property of the bound type. </li> </ul> <p>Do not do both.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload