diff --git a/AIStudio.Wpf.DiagramDesigner/Controls/DesignerCanvas.cs b/AIStudio.Wpf.DiagramDesigner/Controls/DesignerCanvas.cs index e81edad..2b281ae 100644 --- a/AIStudio.Wpf.DiagramDesigner/Controls/DesignerCanvas.cs +++ b/AIStudio.Wpf.DiagramDesigner/Controls/DesignerCanvas.cs @@ -354,8 +354,8 @@ namespace AIStudio.Wpf.DiagramDesigner protected override void OnMouseMove(MouseEventArgs e) { - var focusedElement = Keyboard.FocusedElement; - Debug.WriteLine("focusedElement:" + focusedElement?.ToString()); + //var focusedElement = Keyboard.FocusedElement; + //Debug.WriteLine("focusedElement:" + focusedElement?.ToString()); base.OnMouseMove(e); diff --git a/AIStudio.Wpf.DiagramDesigner/UserControls/LineControl.xaml.cs b/AIStudio.Wpf.DiagramDesigner/UserControls/LineControl.xaml.cs index 4e9b590..1b194b1 100644 --- a/AIStudio.Wpf.DiagramDesigner/UserControls/LineControl.xaml.cs +++ b/AIStudio.Wpf.DiagramDesigner/UserControls/LineControl.xaml.cs @@ -42,7 +42,7 @@ namespace AIStudio.Wpf.DiagramDesigner if (this.DataContext is ConnectionViewModel connector && connector.ColorViewModel != null) { connector.ColorViewModel.PropertyChanged -= Connector_PropertyChanged; - connector.PropertyChanged += Connector_PropertyChanged; + connector.ColorViewModel.PropertyChanged += Connector_PropertyChanged; } this.ball.Visibility = Visibility.Collapsed; await DoAnimation(); @@ -68,13 +68,21 @@ namespace AIStudio.Wpf.DiagramDesigner switch (connector.ColorViewModel.LineAnimation) { case LineAnimation.None: - _story?.Stop(); + _story?.Stop(this); ball.Visibility = Visibility.Collapsed; break; - case LineAnimation.PathAnimation: + case LineAnimation.PathAnimation: + if (connector.ColorViewModel.FillColor.BrushType == BrushType.SolidColorBrush && connector.ColorViewModel.FillColor.Color == Colors.White) + { + connector.ColorViewModel.FillColor.Color = Colors.Red; + } PathAnimation(connector.ColorViewModel.LineAnimationDuration); break; case LineAnimation.DashAnimation: + if (connector.ColorViewModel.LineDashStyle == LineDashStyle.None) + { + connector.ColorViewModel.LineDashStyle = LineDashStyle.Dash1; + } DashAnimation(connector.ColorViewModel.LineAnimationDuration); break; } @@ -118,7 +126,7 @@ namespace AIStudio.Wpf.DiagramDesigner animationAngle.Source = PathAnimationSource.Angle; animationAngle.Duration = animationX.Duration; - _story?.Stop(); + _story?.Stop(this); _story = new Storyboard(); _story.RepeatBehavior = RepeatBehavior.Forever; //story.AutoReverse = true; @@ -132,7 +140,7 @@ namespace AIStudio.Wpf.DiagramDesigner Storyboard.SetTargetProperty(animationY, new PropertyPath(TranslateTransform.YProperty)); Storyboard.SetTargetProperty(animationAngle, new PropertyPath(RotateTransform.AngleProperty)); - _story.Begin(this); + _story.Begin(this, true); } @@ -148,11 +156,11 @@ namespace AIStudio.Wpf.DiagramDesigner Storyboard.SetTargetProperty(animation, new PropertyPath("StrokeDashOffset")); Storyboard.SetTarget(animation, this.line); - _story?.Stop(); + _story?.Stop(this); _story = new Storyboard(); _story.RepeatBehavior = RepeatBehavior.Forever; _story.Children.Add(animation); - _story.Begin(this); + _story.Begin(this, true); } }