Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let's say you have a QueueView that uses a QueueViewModel.</p> <pre><code>public class QueueViewModel : INotifyPropertyChanged { public ParentType Parent { get; set; } public QueueViewModel(ParentType parent) { this.Parent = parent; foreach (ChildType child in Parent) { child.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { if (e.PropertyName != "IsSelected") return; //do something like this: Parent.IsSelected = AllChildrenAreSelected(); }; } } } public class ParentType : INotifyPropertyChanged { private bool _isSelected; public IList&lt;ChildType&gt; Children { get; set; } public bool IsSelected { get { return _isSelected; } set { _isSelected = value; OnPropertyChanged("IsSelected"); } } } public class ChildType : INotifyPropertyChanged { private string _name; private bool _isSelected; public string Name { get { return _name; } set { _name = value; OnPropertyChanged("Name"); } } public bool IsSelected { get { return _isSelected; } set { _isSelected = value; OnPropertyChanged("IsSelected"); } } } </code></pre> <p>-- QueueView part</p> <pre><code>&lt;StackPanel&gt; &lt;CheckBlock Text="{Binding Path=Parent.Name}" IsChecked="{Binding Parent.IsSelected}"/&gt; &lt;ItemsControl ItemsSource="{Binding Path=Parent.Children}"&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;CheckBox Content="{Binding Path=Name}" IsChecked="{Binding Path=IsSelected, Mode=TwoWay}"/&gt; &lt;/DataTemplate&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt; &lt;/StackPanel&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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