title: WPF/MVVM: Dynamically add checkboxes to 2 ColumnGrid based on available Enums
body: <p>I'm currently build a gui for a logger. The logger class has a enum <code>Types</code> with a couple of values defining the different log message types.</p>
  
  <p>Now I want to create a gui for this logger. Part of this gui is a 2 column grid where a checkbox for each log message type is available. It shall be used to filter the log. In order to reduce future coding effort, I would like to add a checkbox for each available type of log message dynamically. So when ever a new value is added to <code>Logger.Types</code> the gui adapts automatically.</p>
  
  <p>My xaml of the checkboxes look something like this:</p>
  
  <pre><code> &lt;CheckBox Name="CheckBoxTypeInformation" Grid.Column="0" Grid.Row="1" 
             Content="{myControls:LocalizationMarkup 'LOGMSG_TYPE_INFORMATION'}" 
             Command="{Binding FilterTypeCommand}" CommandParameter="Information"
             IsChecked="{Binding Path=FilterType[0]}"/&gt;
  </code></pre>
  
  <p>So there is quite some work to be done for each checkbox:</p>
  
  <ol>
  <li>Insert the cb into the 2 column grid in some manner by defining the <code>Grid.Column</code> and <code>Grid.Row</code>. The logic of it is not the problem</li>
  <li>Set the Content with a custom LocalizationMarkup</li>
  <li>Bind a command with dynamic CommandParameter. Here I would like to pass the actual enum value. But I was not able to do so in xaml atm.</li>
  <li>Bind the IsChecked Property to an index in an array holding the IsChecked Status of all checkboxes.</li>
  </ol>
  
  <p>I'm not quite shure how to handle this. As I understood it correctly I somehow have to add an <code>ObservableCollection&lt;&gt;</code> of a new custom class which has properties for each of the 4 wanted tasks.</p>
  
  <p>I hope somebody can point me into the right direction on how to implement something dynamic as described in a propper mvvm/wpf manner.</p>
  
  <p>Thank you very much!</p>