private void OnPageClosed(swPropertyManagerPageCloseReasons_e reason) { m_IsPageOpened = false; SwSpecificControl.Clear(); SwSpecificControl.CurrentSelection = -1; m_CurrentValueCached = GetDefaultItemValue(); m_DynamicItems = null; }
protected override void LoadItemsIntoControl(ItemsControlItem[] newItems) { SwSpecificControl.Clear(); if (newItems?.Any() == true) { SwSpecificControl.AddItems(newItems.Select(i => i.DisplayName).ToArray()); } }
protected override void SetItemsToControl(ItemsControlItem[] items) { SwSpecificControl.Clear(); if (items?.Any() == true) { SwSpecificControl.AddItems(items.Select(i => i.DisplayName).ToArray()); } }
protected override void SetItemsToControl(ItemsControlItem[] items) { SwSpecificControl.Clear(); if (items?.Any() == true) { SwSpecificControl.AddItems(items.Select(x => x.DisplayName).ToArray()); if (m_SelectDefaultValue) { SwSpecificControl.CurrentSelection = 0; ValueChanged?.Invoke(this, (TVal)items.First().Value); } } }
protected override void LoadItemsIntoControl(ItemsControlItem[] newItems) { SwSpecificControl.Clear(); if (newItems?.Any() == true) { SwSpecificControl.AddItems(newItems.Select(x => x.DisplayName).ToArray()); if (!newItems.Any(i => object.Equals(i.Value, m_CurrentValueCached))) { //if items source changed dynamically previously cached value might not fit new source var defVal = GetDefaultItemValue(); if (!object.Equals(m_CurrentValueCached, defVal)) { m_CurrentValueCached = defVal; ValueChanged?.Invoke(this, m_CurrentValueCached); } } SetSpecificValue(m_CurrentValueCached); } }