diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs index adaca4f..7e69a8d 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs @@ -17,7 +17,7 @@ namespace AIStudio.Wpf.Flowchart { public FlowchartViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType) { - + Init(); } public FlowchartViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument) { diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs index bc2df8d..1d644de 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/LogicalViewModel.cs @@ -13,7 +13,7 @@ namespace AIStudio.Wpf.Logical { public LogicalViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType) { - + Init(); } public LogicalViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument) { diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs index 48ec2f7..59ca897 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs @@ -23,6 +23,7 @@ namespace AIStudio.Wpf.Flowchart public MindViewModel(string title, string status, DiagramType diagramType, MindType mindType) : base(title, status, diagramType) { MindType = mindType; + Init(); } public MindViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument) { diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs index 7070705..9a493ea 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs @@ -32,8 +32,6 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels Title = title; Status = status; DiagramType = diagramType; - - Init(); } public PageViewModel(string filename) { diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs index ca15767..1ada18a 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/SFCViewModel.cs @@ -20,8 +20,9 @@ namespace AIStudio.Wpf.Flowchart { public SFCViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType) { - + Init(); } + public SFCViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument) { if (DiagramViewModel != null) diff --git a/AIStudio.Wpf.DiagramDesigner.Additionals/AIStudio.Wpf.DiagramDesigner.Additionals_parkdvui_wpftmp.csproj b/AIStudio.Wpf.DiagramDesigner.Additionals/AIStudio.Wpf.DiagramDesigner.Additionals_parkdvui_wpftmp.csproj new file mode 100644 index 0000000..4af40a4 --- /dev/null +++ b/AIStudio.Wpf.DiagramDesigner.Additionals/AIStudio.Wpf.DiagramDesigner.Additionals_parkdvui_wpftmp.csproj @@ -0,0 +1,228 @@ + + + AIStudio.Wpf.DiagramDesigner.Additionals + obj\Debug\ + obj\ + F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner.Additionals\obj\ + <_TargetAssemblyProjectName>AIStudio.Wpf.DiagramDesigner.Additionals + + + + true + true + AIStudio.Wpf.Controls + akwkevin + https://gitee.com/akwkevin + A.png + + + 1.0.1 + 一个Wpf的Diagram控件帮助库 + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs b/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs index f26f80c..958c9af 100644 --- a/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs +++ b/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs @@ -162,7 +162,7 @@ namespace AIStudio.Wpf.DiagramDesigner if (fitviewmodel != null) { target.OnFitViewModelChanged(fitviewmodel); - } + } } private void OnFitViewModelChanged(FitViewModel fitViewModel) @@ -171,7 +171,7 @@ namespace AIStudio.Wpf.DiagramDesigner { if (fitViewModel.FitMode == FitMode.None) { - + } else if (fitViewModel.FitMode == FitMode.FitWidth) { @@ -187,12 +187,17 @@ namespace AIStudio.Wpf.DiagramDesigner (this.ScrollViewer.ViewportWidth * fitViewModel.PaddingRate) / fitViewModel.BoundingRect.Width, (this.ScrollViewer.ViewportHeight * fitViewModel.PaddingRate) / fitViewModel.BoundingRect.Height ); - } - + } + double xOffset, yOffset; xOffset = fitViewModel.BoundingRect.Left * ZoomValue - (this.ScrollViewer.ViewportWidth - fitViewModel.BoundingRect.Width * ZoomValue) / 2; yOffset = fitViewModel.BoundingRect.Top * ZoomValue - (this.ScrollViewer.ViewportHeight - fitViewModel.BoundingRect.Height * ZoomValue) / 2; - this.ScrollViewer.ScrollToHorizontalOffset(xOffset); + if (OffSet) + { + Vector vector = System.Windows.Media.VisualTreeHelper.GetOffset(DesignerCanvas); + xOffset += vector.X; + yOffset += vector.Y; + } this.ScrollViewer.ScrollToVerticalOffset(yOffset); } } @@ -200,7 +205,7 @@ namespace AIStudio.Wpf.DiagramDesigner public ZoomBox() { - this.Loaded += ZoomBox_Loaded; + this.Loaded += ZoomBox_Loaded; } private void ZoomBox_Loaded(object sender, RoutedEventArgs e) @@ -231,7 +236,7 @@ namespace AIStudio.Wpf.DiagramDesigner this.zoomThumb.DragDelta += new DragDeltaEventHandler(this.Thumb_DragDelta); this.zoomSlider.ValueChanged += new RoutedPropertyChangedEventHandler(this.ZoomSlider_ValueChanged); - + } private void ZoomSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) @@ -340,12 +345,12 @@ namespace AIStudio.Wpf.DiagramDesigner { public Rect BoundingRect { - get;set; + get; set; } public FitMode FitMode { - get;set; + get; set; } public double PaddingRate diff --git a/AIStudio.Wpf.Mind/Controls/NodeDTSWindow.xaml b/AIStudio.Wpf.Mind/Controls/NodeDTSWindow.xaml new file mode 100644 index 0000000..b50cf0c --- /dev/null +++ b/AIStudio.Wpf.Mind/Controls/NodeDTSWindow.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + +