internal void Cleanup() { GadgetItemsSource.Clear(); GadgetCheckedCollection.Clear(); m_CurrentEditGadget.CopyFrom(GadgetTest.CreateDefault); }
void SortItemsSourceCollection() { var list = GadgetItemsSource .OrderBy(p => p.GadgetInfo) .ToList() ; GadgetItemsSource.Clear(); foreach (var item in list) { GadgetItemsSource.Add(item); } }
void MaterialChanged() { if (m_CurrentMaterialGadget.ValidateId) { GadgetItemsSource.Clear(); foreach (var gadgetTest in GadgetFullCollection) { if (gadgetTest.Material.Equals(m_CurrentMaterialGadget.Material, StringComparison.InvariantCulture)) { var checkedItem = IsChecked(gadgetTest.Id); if (checkedItem.ValidateId.IsFalse()) { if (gadgetTest.Enabled) { if (gadgetTest.Busy.IsFalse()) { // only Target content if (gadgetTest.HasContentTarget) { gadgetTest.Material = m_CurrentMaterialGadget.Material; AddGadget(gadgetTest); } } } } else { AddGadget(checkedItem); } } } UpdateCurrentEditGadget(); SortItemsSourceCollection(); } }