Example #1
0
 private void OnPageClosed(swPropertyManagerPageCloseReasons_e reason)
 {
     m_IsPageOpened = false;
     SwSpecificControl.Clear();
     SwSpecificControl.CurrentSelection = -1;
     m_CurrentValueCached = GetDefaultItemValue();
     m_DynamicItems       = null;
 }
Example #2
0
        protected override void LoadItemsIntoControl(ItemsControlItem[] newItems)
        {
            SwSpecificControl.Clear();

            if (newItems?.Any() == true)
            {
                SwSpecificControl.AddItems(newItems.Select(i => i.DisplayName).ToArray());
            }
        }
Example #3
0
        protected override void SetItemsToControl(ItemsControlItem[] items)
        {
            SwSpecificControl.Clear();

            if (items?.Any() == true)
            {
                SwSpecificControl.AddItems(items.Select(i => i.DisplayName).ToArray());
            }
        }
Example #4
0
        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);
                }
            }
        }
Example #5
0
        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);
            }
        }