예제 #1
0
        private void UIElement_OnMouseMove(object sender, MouseEventArgs e)
        {
            if (sender is UIElement el && el.IsMouseCaptured)
            {
                _endPoint = e.GetPosition(WorkCanvas);

                SetPath();

                var hit = HitTestHelper.HitTest(WorkCanvas, _endPoint)?.VisualHit;

//                Debug.Print(hit?.GetType()?.Name ?? "-");
                var dest = hit?.FindVisualParent <PinView>();
//                Debug.Print(dest==null?"-":"x");
                if (dest == null || IsConnectable(dest))
                {
                    _dest = dest;
                }
                else
                {
                    _dest = null;
                }
            }
        }
예제 #2
0
 private bool IsConnectable(PinView dest)
 {
     return(StartViewModel.IsConnectable(dest.ViewModel));
 }