private void SelectionChanged(SelectionChangedType selectionChangedType) { this.exampleItem = null; if (base.MenuTree.Selection.SelectedValue is Type type) { this.exampleItem = AllTrickOverViewUtilities.GetItemByType(type); } }
protected override OdinMenuTree BuildMenuTree() { OdinMenuTree odinMenuTree = new OdinMenuTree(); odinMenuTree.Selection.SupportsMultiSelect = false; odinMenuTree.Selection.SelectionChanged += this.SelectionChanged; odinMenuTree.Config.DrawSearchToolbar = true; odinMenuTree.Config.DefaultMenuStyle.Height = 22; AllTrickOverViewUtilities.BuildMenuTree(odinMenuTree); return(odinMenuTree); }
private void SelectionChanged(SelectionChangedType selectionChangedType) { exampleItem?.GetExample().Destroy(); m_ShouldDrawExampleCreatorUI = false; this.exampleItem = null; if (base.MenuTree.Selection.SelectedValue is Type type) { this.exampleItem = AllTrickOverViewUtilities.GetItemByType(type); //每次选择的TreeView变化时都要进行Init this.exampleItem.GetExample().Init(); } }