internal void SetSelected(ToolboxCategory selected) { foreach (object child in Items) { ToolboxCategory category = ItemContainerGenerator.ContainerFromItem(child) as ToolboxCategory; if (category != null) { if (category == selected) { category.IsSelectedCategory = true; } else { category.IsSelectedCategory = false; } } } if (selected != null) { SelectedCategoryItem = selected.SelectedItem; } if (SelectionChanged != null) { SelectionChanged(this, new EventArgs()); } }
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { IsPressed = false; e.Handled = true; ToolboxCategory parent = ItemsControl.ItemsControlFromItemContainer(this) as ToolboxCategory; if (parent != null) { parent.NotifyToolboxItemMouseUp(this); } base.OnMouseLeftButtonUp(e); }
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { ToolboxCategory parent = ItemsControl.ItemsControlFromItemContainer(this) as ToolboxCategory; if (e.OriginalSource != parent) { IsPressed = true; } e.Handled = true; if (parent != null) { parent.NotifyToolboxItemMouseDown(this); } base.OnMouseLeftButtonUp(e); }
internal void SetSelected(ToolboxCategory selected) { foreach (object child in Items) { ToolboxCategory category = ItemContainerGenerator.ContainerFromItem(child) as ToolboxCategory; if (category != null) { if (category == selected) category.IsSelectedCategory = true; else category.IsSelectedCategory = false; } } if (selected != null) { SelectedCategoryItem = selected.SelectedItem; } if (SelectionChanged != null) SelectionChanged(this, new EventArgs()); }