title: Changing a <Type> Listbox backcolor
body: <p>I have a Listbox that holds a list of type customer. So my Listbox.Items is not of type ListItem anymore, it is of type customer.</p>
  
  <p>I have an isActive flag in the customer field and I was wondering how I would set the back color say to red, if the isActive is true.</p>
  
  <p>Currently I have tried this but it doesnt work since I can't cast Customers to type ListBoxtem</p>
  
  <pre><code>            List&lt;object&gt; inactiveCustomers = new List&lt;object&gt;();
          foreach (Customer item in ListBoxCustomers.Items)
          {
              if (!item.IsActive)
              {
                  inactiveCustomers.Add(item);
                  int index = ListBoxCustomers.Items.IndexOf(item);
                  ListBoxItem x = (ListBoxItem)ListBoxCustomers.Items[index];
                  x.Background = Brushes.Red;
              }
          }
  </code></pre>
  
  <p>EDIT:
  I am calling a method that does the above code whenever I deselect a checkbox that is for active customers. Whenever I deselect the Active Checkbox, I iterate through the customers and display all of them, and at this time, I would like to change the backcolor of the inactive to distinguish which ones are inactve/active</p>