Esempio n. 1
0
 private static void Raise(UIElement target, PathBuilder path, bool isAdd)
 {
     if (isAdd)
     {
         var drawingCreated = new RoutedEventArgs <PathGeometry>(DrawingCreatedEvent, path.Geometry);
         target.RaiseEvent(drawingCreated);
     }
     else
     {
         var drawingCreated = new RoutedEventArgs <PathGeometry>(DrawingCreatedEvent, path.Geometry);
         target.RaiseEvent(drawingCreated);
     }
 }
Esempio n. 2
0
        private static UIElement Complete(object sender)
        {
            var casted = (UIElement)sender;

            casted.ReleaseMouseCapture();

            PathBuilder builder = GetPathInProgress(casted);

            SetPathInProgress(casted, null);
            SetCurrentDrawingSource(casted, eDrawingSource.None);

            Raise(casted, builder, isAdd: true);
            return(casted);
        }
Esempio n. 3
0
 private static void SetPathInProgress(DependencyObject obj, PathBuilder value) => obj.SetValue(PathInProgressPropertyKey, value);