Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Do you mean something like this?</p> <p><strong>SubSystem class</strong></p> <pre><code>public class SubSystem : INotifyPropertyChanged { private string mName; private Boolean mIsSelected = false; public SubSystem() { } public SubSystem(string name, Boolean isSelected) { this.Name = name; this.IsSelected = isSelected; } public string Name { get { return mName; } set { if (mName != value) { mName = value; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Name")); } } } public Boolean IsSelected { get { return mIsSelected; } set { if (mIsSelected != value) { mIsSelected = value; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("IsSelected")); } } } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion } </code></pre> <p><strong>ViewModel</strong></p> <pre><code>ObservableCollection&lt;SubSystem&gt; mSubSystems = new ObservableCollection&lt;SubSystem&gt;(); public ObservableCollection&lt;SubSystem&gt; SubSystems { get { return mSubSystems; } set { mSubSystems = value; } } </code></pre> <p><strong>View</strong></p> <pre><code>&lt;ListBox x:Name="lstSubsystems" ItemsSource="{Binding SubSystems}"&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;CheckBox IsChecked="{Binding IsSelected}"&gt; &lt;ContentPresenter Content="{Binding Name}" /&gt; &lt;/CheckBox&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; </code></pre> <p>Hope that helps, Wts</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. 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