コード例 #1
0
 public FreeFormPanel()
 {
     this.SnapsToDevicePixels = true;
     this.AllowDrop           = true;
     connectorEditor          = null;
     lastYPosition            = FreeFormPanel.TopStackingMargin;
 }
コード例 #2
0
 public EditPointAdorner(ConnectorEditor cEditor, UIElement adornedElement, bool shouldDrawLines)
     : base(adornedElement)
 {
     Debug.Assert(adornedElement != null, "Adorned element is null.");
     adornedEditor         = cEditor;
     this.IsHitTestVisible = false;
     this.drawLines        = shouldDrawLines;
 }
コード例 #3
0
 public void RemoveConnectorEditor()
 {
     if (connectorEditor != null)
     {
         connectorEditor.Remove();
         connectorEditor = null;
     }
 }
コード例 #4
0
 void CreateNewConnectorEditor(MouseButtonEventArgs e)
 {
     if (connectorEditor == null || !e.Source.Equals(connectorEditor.Connector))
     {
         //If user clicks anywhere other than the connector editor, destroy it.
         RemoveConnectorEditor();
         if (e.Source.GetType().IsAssignableFrom(typeof(Connector)))
         {
             this.connectorEditor = new ConnectorEditor(this, e.Source as Connector);
         }
     }
 }
コード例 #5
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     if (e != null && !this.Disabled && this.IsOutmostPanel())
     {
         if (e.Key == Key.Escape)
         {
             //If escape key is hit while dragging a connector, end dragging.
             if (connectorEditor != null && connectorEditor.BeingEdited)
             {
                 Connector affectedConnector = connectorEditor.Connector;
                 RemoveConnectorEditor();
                 this.connectorEditor = new ConnectorEditor(this, affectedConnector);
                 e.Handled            = true;
             }
         }
     }
     base.OnKeyDown(e);
 }