public DesignPanel() { this.Focusable = true; this.Margin = new Thickness(16); DesignerProperties.SetIsInDesignMode(this, true); _eatAllHitTestRequests = new EatAllHitTestRequests(); _eatAllHitTestRequests.MouseDown += delegate { // ensure the design panel has focus while the user is interacting with it this.Focus(); }; _eatAllHitTestRequests.AllowDrop = true; _adornerLayer = new AdornerLayer(this); }
public DesignPanel() { this.Focusable = true; this.Margin = new Thickness(16); DesignerProperties.SetIsInDesignMode(this, true); _eatAllHitTestRequests = new EatAllHitTestRequests(); _eatAllHitTestRequests.MouseDown += delegate { // ensure the design panel has focus while the user is interacting with it this.Focus(); }; _eatAllHitTestRequests.AllowDrop = true; _adornerLayer = new AdornerLayer(this); this.PreviewKeyUp += DesignPanel_KeyUp; this.PreviewKeyDown += DesignPanel_KeyDown; }