public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) { base.Init(ve, bag, cc); var lf = (PlatformLevelSelector)ve; int val = 0; if (!m_Value.TryGetValueFromBag(bag, cc, ref val)) { val = GetChoices().Last(); } lf.SetValueWithoutNotify(val); }
public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) { base.Init(ve, bag, cc); int itemHeight = 0; var veTemp = (TreeView)ve; if (m_ItemHeight.TryGetValueFromBag(bag, cc, ref itemHeight)) { veTemp.itemHeight = itemHeight; } //veTemp.showBorder = m_ShowBorder.GetValueFromBag(bag, cc); veTemp.selectionType = m_SelectionType.GetValueFromBag(bag, cc); //veTemp.showAlternatingRowBackgrounds = m_ShowAlternatingRowBackgrounds.GetValueFromBag(bag, cc); }
public override void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc) { base.Init(ve, bag, cc); var itemHeight = 0; var listView = (ListView)ve; // Avoid setting itemHeight unless it's explicitly defined. // Setting itemHeight property will activate inline property mode. if (m_ItemHeight.TryGetValueFromBag(bag, cc, ref itemHeight)) { listView.itemHeight = itemHeight; } listView.showBorder = m_ShowBorder.GetValueFromBag(bag, cc); listView.selectionType = m_SelectionType.GetValueFromBag(bag, cc); listView.showAlternatingRowBackgrounds = m_ShowAlternatingRowBackgrounds.GetValueFromBag(bag, cc); listView.showBoundCollectionSize = m_ShowBoundCollectionSize.GetValueFromBag(bag, cc); }