private void C_CreatedCancelled(object sender, EventArgs e) { if (!(sender is IToolboxCategory category)) { return; } category.Created -= C_Created; category.CreatedCancelled -= C_CreatedCancelled; _service.RemoveCategory(category); }
protected override void OnExecute(object parameter) { if (!(_toolbox.SelectedNode is IToolboxCategory category)) { return; } if (ToolboxCategory.IsDefaultCategory(category)) { return; } _service.RemoveCategory(category); }
private void MoveCategoryUp(IToolboxCategory category) { if (category == null) { return; } var items = _service.GetToolboxItemSource(); var index = items.IndexOf(x => x.Equals(category)); _service.RemoveCategory(category, false, true); _service.InsertCategory(index - 1, category); _toolbox.SelectedNode = category; }