title: Bind Flag enums to listbox containing checkboxes
body: <p>I have flag enum say this -</p>
  
  <pre><code>[Flags]
  public enum Department
  {
      None = 0,
      A = 1,
      B = 2,
      C = 4,
      D = 8
  }
  </code></pre>
  
  <p>I want to show values of this enum on view. I thought of creating a listbox and binding its source to the collection of this enum <code>List&lt;Department&gt; Departments</code>.
  All works so good until i thought of having a checkbox which binds to a property on my Viewmodel -</p>
  
  <pre><code>public Department SelectedDepartments { get; set; }
  </code></pre>
  
  <p>The solution here <a href="http://compilewith.net/2008/12/wpf-flagsenumvalueconverter.html" rel="nofollow">http://compilewith.net/2008/12/wpf-flagsenumvalueconverter.html</a> provides elegant solution for binding enum values to checkboxes but its have one limitation of creating checkboxes equal to the number of enum values in list.
  But, in my case i can't afford of having so many checkboxes lying on my UI since my Enum contains 20 values (so that means having 20 checkboxes on UI).</p>
  
  <p>I tried using <code>MultiBindingConverter</code> but that fails in <code>ConvertBack</code> Method.
  I want to bind the state of checkboxes with property SelectedDepartments. Say if property value is "A | B" then A and B checkbox should be checked whereas C and D should remain unchecked.</p>