コード例 #1
0
 private void OnMouseUp(object sender, MouseButtonEventArgs e)
 {
     EventBus.PostEvent(new ConnectionPointMouseUpEvent(e)
     {
         Target = (ConnectionPoint)this.View
     });
 }
コード例 #2
0
 private void OnMouseUp(object sender, MouseButtonEventArgs e)
 {
     if (!(e.OriginalSource is Canvas))
     {
         return;                                 //why do I have to do this?
     }
     EventBus.PostEvent(new DesignerMouseUpEvent(e));
 }
コード例 #3
0
        private void OnControlDropped(object sender, DragEventArgs e)
        {
            //Logic here for pulling information from
            //UI so that we can build the control/component

            //the following is only temporary
            if (string.IsNullOrEmpty(e.Data.GetData(DataFormats.Text).ToString()))
            {
                return;
            }

            //Notify subscribers of ControlDropped event
            EventBus.PostEvent(new ControlDroppedEvent(e));

            IParameter parameter = new ControlParameter()
            {
                Canvas   = _parameter.Canvas,
                Position = e.GetPosition(_parameter.Canvas)
            };

            this.AddChild <ControlPresenter>(EventBus, parameter);
        }
コード例 #4
0
        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            if (!_hasCapture)
            {
                return;
            }

            double x = e.GetPosition(_parameter.Canvas).X;
            double y = e.GetPosition(_parameter.Canvas).Y;

            _relativePosition.X += x - _position.X;
            _relativePosition.Y += y - _position.Y;

            _position.X = x;
            _position.Y = y;

            EventBus.PostEvent(new ControlMovedEvent(e)
            {
                Position            = _relativePosition,
                SetPositionCallback = SetPosition
            });
        }
コード例 #5
0
 private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     //Notify designer controls of MouseDown event
     EventBus.PostEvent(new DesignerMouseDownEvent(e));
 }
コード例 #6
0
 private void OnMouseMove(object sender, MouseEventArgs e)
 {
     EventBus.PostEvent(new DesignerMouseMoveEvent(e));
 }