diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs index 6c9d0a3..3ef6179 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs @@ -33,7 +33,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels DiagramViewModels = new ObservableCollection() { - new DiagramViewModel(){Name= "页-1", DiagramType = diagramType, ZoomValue = 0.8}, + new DiagramViewModel(){Name= "页-1", DiagramType = diagramType}, }; DiagramViewModel = DiagramViewModels.FirstOrDefault(); diff --git a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml index 7f34f49..435b29d 100644 --- a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml +++ b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml @@ -1896,13 +1896,13 @@ - + Margin="0,0,5,5" /> diff --git a/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs b/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs index c78b8b2..6ef5cd9 100644 --- a/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs +++ b/AIStudio.Wpf.DiagramDesigner/Controls/ZoomBox.cs @@ -24,24 +24,7 @@ namespace AIStudio.Wpf.DiagramDesigner } public static readonly DependencyProperty ScrollViewerProperty = - DependencyProperty.Register(nameof(ScrollViewer), typeof(ScrollViewer), typeof(ZoomBox), new FrameworkPropertyMetadata(null, - new PropertyChangedCallback(OnScrollViewerChanged))); - - private static void OnScrollViewerChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ZoomBox target = (ZoomBox)d; - ScrollViewer oldvalue = (ScrollViewer)e.OldValue; - ScrollViewer newvalue = (ScrollViewer)e.NewValue; - target.OnScrollViewerChanged(oldvalue, newvalue); - } - - protected virtual void OnScrollViewerChanged(ScrollViewer oldvalue, ScrollViewer newvalue) - { - if (newvalue != null) - { - DesignerCanvas = VisualHelper.FindChild(newvalue); - } - } + DependencyProperty.Register(nameof(ScrollViewer), typeof(ScrollViewer), typeof(ZoomBox)); #endregion #region DesignerCanvas @@ -154,8 +137,8 @@ namespace AIStudio.Wpf.DiagramDesigner double scale, xOffset, yOffset; this.InvalidateScale(out scale, out xOffset, out yOffset); - this.zoomThumb.Width = this.ScrollViewer.ViewportWidth * scale; - this.zoomThumb.Height = this.ScrollViewer.ViewportHeight * scale; + this.zoomThumb.Width = (this.ScrollViewer.ViewportWidth) * scale; + this.zoomThumb.Height = (this.ScrollViewer.ViewportHeight) * scale; Canvas.SetLeft(this.zoomThumb, xOffset + this.ScrollViewer.HorizontalOffset * scale); Canvas.SetTop(this.zoomThumb, yOffset + this.ScrollViewer.VerticalOffset * scale); } diff --git a/AIStudio.Wpf.DiagramDesigner/Styles/ZoomBox.xaml b/AIStudio.Wpf.DiagramDesigner/Styles/ZoomBox.xaml index 7ed812c..8c87a02 100644 --- a/AIStudio.Wpf.DiagramDesigner/Styles/ZoomBox.xaml +++ b/AIStudio.Wpf.DiagramDesigner/Styles/ZoomBox.xaml @@ -181,7 +181,7 @@ Name="PART_ZoomCanvas"> + Visual="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ScrollViewer.Content}" /> @@ -205,34 +205,24 @@ - + - - + Margin="0,0,2,0" /> diff --git a/AIStudio.Wpf.Mind/MindType.cs b/AIStudio.Wpf.Mind/MindType.cs new file mode 100644 index 0000000..8cf7bf6 --- /dev/null +++ b/AIStudio.Wpf.Mind/MindType.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace AIStudio.Wpf.Mind +{ + public enum MindType + { + [Description("思维导图")] + Mind, + [Description("目录组织图")] + Directory, + [Description("鱼骨头图")] + FishBone, + [Description("逻辑结构图")] + Logical, + [Description("组织结构图")] + Organizational, + [Description("天盘图")] + Celestial + } +} diff --git a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs index 75b1e31..21114a3 100644 --- a/AIStudio.Wpf.Mind/ViewModels/MindNode.cs +++ b/AIStudio.Wpf.Mind/ViewModels/MindNode.cs @@ -1,8 +1,10 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using System.Text; using AIStudio.Wpf.DiagramDesigner; +using AIStudio.Wpf.DiagramDesigner.Geometrys; using AIStudio.Wpf.DiagramDesigner.Models; namespace AIStudio.Wpf.Mind.ViewModels @@ -55,6 +57,10 @@ namespace AIStudio.Wpf.Mind.ViewModels { get; set; } + + + + } public class MindLevel1Node : MindNode @@ -78,6 +84,24 @@ namespace AIStudio.Wpf.Mind.ViewModels { } + + public void LayoutUpdated() + { + foreach(var child in Children) + { + + } + } + + public RectangleBase Rectangle + { + get; set; + } + + public RectangleBase GetChildRectangle() + { + //Children.Select(p => p.Size) + } } public class MindLevel2Node : MindNode @@ -101,6 +125,11 @@ namespace AIStudio.Wpf.Mind.ViewModels { } + + public PointBase Offset + { + get; set; + } } public class MindLevel3Node : MindNode @@ -124,5 +153,10 @@ namespace AIStudio.Wpf.Mind.ViewModels { } + + public PointBase Offset + { + get; set; + } } } diff --git a/Directory.Build.Props b/Directory.Build.Props index 801ea2a..4d652c4 100644 --- a/Directory.Build.Props +++ b/Directory.Build.Props @@ -1,7 +1,7 @@ - netcoreapp3.1;net461;net5.0-windows + netcoreapp3.1;net5.0-windows