/// <summary> /// Mouse clicked for selection /// </summary> /// <param name="e"></param> protected override void OnPreviewMouseDown(MouseButtonEventArgs e) { base.OnPreviewMouseDown(e); DesignerCanvas canvas = VisualTreeHelper.GetParent(this) as DesignerCanvas; if (canvas != null) { if ((Keyboard.Modifiers & (ModifierKeys.Shift | ModifierKeys.Control)) != ModifierKeys.None) { IsSelected = !IsSelected; DesignerCanvas.SetZIndex(this, !IsSelected ? ZIndexUnSelectedValue : ZIndexSelectedValue); canvas.DeselectTables(); } else { if (!IsSelected) { canvas.ResetZIndexes(); canvas.DeselectLabels(); canvas.DeselectTables(); IsSelected = true; DesignerCanvas.SetZIndex(this, ZIndexSelectedValue); } } } e.Handled = false; }