mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-05-01 13:39:28 +08:00
Revert "Revert "block 可以拖拽到内部,还有少量问题待解决""
This reverts commit fcd7beb193.
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Mind;component/Themes/Generic.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Script.Core;component/Themes/RoslynScriptViewModel.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Script;component/Themes/ColorBoxFactoryScriptViewModel.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Script;component/Themes/ColorBoxCollectorScriptViewModel.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Script;component/Themes/ColorBoxCollectorScriptViewModel.xaml" />
|
||||
<!--<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Block;component/Themes/BlockItemViewModel.xaml" />-->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
{
|
||||
public class PathToolBoxData : ToolBoxData
|
||||
{
|
||||
public PathToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, icon, type, width, height, desiredSize, description)
|
||||
public PathToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(null, icon, type, width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
}
|
||||
@@ -23,7 +23,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
|
||||
public class TextToolBoxData : ToolBoxData
|
||||
{
|
||||
public TextToolBoxData(string text, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(text, null, type, width, height, desiredSize, description)
|
||||
public TextToolBoxData(string text, Type type, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(text, null, type, width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
}
|
||||
@@ -32,7 +32,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
|
||||
public class EllipseTextToolBoxData : ToolBoxData
|
||||
{
|
||||
public EllipseTextToolBoxData(string text, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(text, null, type, width, height, desiredSize, description)
|
||||
public EllipseTextToolBoxData(string text, Type type, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(text, null, type, width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
|
||||
public class ImageToolBoxData : ToolBoxData
|
||||
{
|
||||
public ImageToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, icon, type, width, height, desiredSize, description)
|
||||
public ImageToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(null, icon, type, width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public DesignerItemToolBoxData(DesignerItemBase designerItemBase, string filename, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, null, type, width, height, desiredSize, description)
|
||||
public DesignerItemToolBoxData(DesignerItemBase designerItemBase, string filename, Type type, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(null, null, type, width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
Addition = designerItemBase;
|
||||
DesignerItemViewModel = Activator.CreateInstance(type, null, designerItemBase) as DesignerItemViewModelBase;
|
||||
@@ -84,7 +84,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public MultipleDesignerItemToolBoxData(SerializableObject designerItemBase, string filename, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, null, typeof(List<SelectableDesignerItemViewModelBase>), width, height, desiredSize, description)
|
||||
public MultipleDesignerItemToolBoxData(SerializableObject designerItemBase, string filename, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(null, null, typeof(List<SelectableDesignerItemViewModelBase>), width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
SelectableDesignerItemViewModels = designerItemBase.ToObject();
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
|
||||
public class SvgToolBoxData : ToolBoxData
|
||||
{
|
||||
public SvgToolBoxData(string filename, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, filename, type, width, height, desiredSize, description)
|
||||
public SvgToolBoxData(string filename, Type type, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(null, filename, type, width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Blue;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
|
||||
public class MediaToolBoxData : ToolBoxData
|
||||
{
|
||||
public MediaToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(icon, null, type, width, height, desiredSize, description)
|
||||
public MediaToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, Size? desiredMinSize = null, string description = null) : base(icon, null, type, width, height, desiredSize, desiredMinSize, description)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
48
AIStudio.Wpf.DiagramApp/ViewModels/BlockViewModel.cs
Normal file
48
AIStudio.Wpf.DiagramApp/ViewModels/BlockViewModel.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
//using AIStudio.Wpf.Block.ViewModels;
|
||||
using AIStudio.Wpf.DiagramApp.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
internal class BlockViewModel : PageViewModel
|
||||
{
|
||||
public BlockViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
|
||||
{
|
||||
|
||||
}
|
||||
public BlockViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void InitDiagramViewModel()
|
||||
{
|
||||
base.InitDiagramViewModel();
|
||||
|
||||
DiagramViewModel.DiagramOption.LayoutOption.ShowGrid = false;
|
||||
}
|
||||
|
||||
protected override void Init(bool initNew)
|
||||
{
|
||||
base.Init(initNew);
|
||||
|
||||
//StartBlockItemViewModel start = new StartBlockItemViewModel(DiagramViewModel) { Left = 28, Top = 28 };
|
||||
//DiagramViewModel.Add(start);
|
||||
|
||||
//WaitTimeBlockItemViewModel waittime = new WaitTimeBlockItemViewModel(DiagramViewModel) { Left = 28, Top = 28 };
|
||||
//DiagramViewModel.Add(waittime);
|
||||
|
||||
//AddBlockItemViewModel add = new AddBlockItemViewModel(DiagramViewModel) { Left = 28, Top = 28 };
|
||||
//DiagramViewModel.Add(add);
|
||||
|
||||
//KeyboardPressBlockItemViewModel keyboardPress = new KeyboardPressBlockItemViewModel(DiagramViewModel) { Left = 28, Top = 28 };
|
||||
//DiagramViewModel.Add(keyboardPress);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ using AIStudio.Wpf.DiagramDesigner.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels.BaseViewModel;
|
||||
using AIStudio.Wpf.Mind;
|
||||
using AIStudio.Wpf.Mind.Models;
|
||||
using ControlzEx.Controls;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
@@ -545,6 +546,10 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
flow = new DrawingViewModel(filename, diagram);
|
||||
}
|
||||
else if (diagram.DiagramType == DiagramType.Block)
|
||||
{
|
||||
flow = new BlockViewModel(filename, diagram);
|
||||
}
|
||||
else
|
||||
{
|
||||
flow = new PageViewModel(filename, diagram);
|
||||
@@ -668,6 +673,10 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
PageViewModel = new DrawingViewModel(NewNameHelper.GetNewName(PageViewModels.Select(p => p.Title), "新建-"), "*", (DiagramType)Enum.Parse(typeof(DiagramType), type));
|
||||
}
|
||||
else if (type == DiagramType.Block.ToString())
|
||||
{
|
||||
PageViewModel = new BlockViewModel(NewNameHelper.GetNewName(PageViewModels.Select(p => p.Title), "新建-"), "*", (DiagramType)Enum.Parse(typeof(DiagramType), type));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageViewModel = new PageViewModel(NewNameHelper.GetNewName(PageViewModels.Select(p => p.Title), "新建-"), "*", (DiagramType)Enum.Parse(typeof(DiagramType), type));
|
||||
|
||||
@@ -20,6 +20,7 @@ using ZXing;
|
||||
using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels.BaseViewModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
@@ -34,29 +35,48 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public PageViewModel(string title, string status, DiagramType diagramType, string subType = null)
|
||||
{
|
||||
Title = title;
|
||||
Status = status;
|
||||
DiagramType = diagramType;
|
||||
SubType = subType;
|
||||
Init(true);
|
||||
|
||||
}
|
||||
public PageViewModel(string filename)
|
||||
{
|
||||
FileName = filename;
|
||||
string ext = Path.GetExtension(filename);
|
||||
var diagramDocument = OpenFile(filename, ext);
|
||||
OpenFile(diagramDocument, ext);
|
||||
DiagramDocument = OpenFile(filename, ext);
|
||||
}
|
||||
|
||||
public PageViewModel(string filename, DiagramDocument diagramDocument)
|
||||
{
|
||||
FileName = filename;
|
||||
string ext = Path.GetExtension(filename);
|
||||
OpenFile(diagramDocument, ext);
|
||||
DiagramDocument = diagramDocument;
|
||||
}
|
||||
|
||||
DiagramDocument DiagramDocument;
|
||||
public virtual void View_Loaded(object sender, EventArgs e)
|
||||
{
|
||||
//await Task.Run(() => {
|
||||
//Application.Current.Dispatcher.Invoke(() => {
|
||||
if (string.IsNullOrEmpty(FileName))
|
||||
{
|
||||
Init(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
string ext = Path.GetExtension(FileName);
|
||||
OpenFile(DiagramDocument, ext);
|
||||
}
|
||||
//});
|
||||
//});
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected virtual void InitDiagramViewModel()
|
||||
{
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
public SFCViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
|
||||
{
|
||||
Init(true);
|
||||
|
||||
}
|
||||
|
||||
public SFCViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
|
||||
public ScriptViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
|
||||
{
|
||||
Init(true);
|
||||
|
||||
}
|
||||
|
||||
public ScriptViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
@@ -61,8 +61,8 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
ConsoleLogViewModel logNode = new ConsoleLogViewModel(DiagramViewModel) { Name = "Log", Left = 150, Top = 420 };
|
||||
DiagramViewModel.Add(logNode);
|
||||
|
||||
IntScriptViewModel intLog = new IntScriptViewModel(DiagramViewModel) { Name = "Int", Left = 40, Top = 220 };
|
||||
DiagramViewModel.Add(intLog);
|
||||
IntScriptViewModel intNode = new IntScriptViewModel(DiagramViewModel) { Name = "Int", Left = 40, Top = 220 };
|
||||
DiagramViewModel.Add(intNode);
|
||||
|
||||
ColorBoxFactoryScriptViewModel factoryNode = new ColorBoxFactoryScriptViewModel(DiagramViewModel) { Name = "ColorBoxFactory", Left = 150, Top = 150 };
|
||||
DiagramViewModel.Add(factoryNode);
|
||||
@@ -111,7 +111,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
collectorNode7.Tag = new ColorBoxModel("紫色|六边形", "M 0,20 L 10,0 H 50 L 60,20 L 50,40 H10 Z", Colors.Purple);
|
||||
DiagramViewModel.Add(collectorNode7);
|
||||
|
||||
ConnectionViewModel int_factoryConnector = new ConnectionViewModel(DiagramViewModel, intLog.Output[0], factoryNode.Input[0], DrawMode.ConnectingLineSmooth, RouterMode.RouterNormal);
|
||||
ConnectionViewModel int_factoryConnector = new ConnectionViewModel(DiagramViewModel, intNode.Output[0], factoryNode.Input[0], DrawMode.ConnectingLineSmooth, RouterMode.RouterNormal);
|
||||
DiagramViewModel.Add(int_factoryConnector);
|
||||
|
||||
ConnectionViewModel bool_switchConnector = new ConnectionViewModel(DiagramViewModel, boolNode.Output[0], switchNode.Input[0], DrawMode.ConnectingLineSmooth, RouterMode.RouterNormal);
|
||||
@@ -191,7 +191,9 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
item.Execute();
|
||||
}
|
||||
readDataTimer.Start();
|
||||
|
||||
if (readDataTimer != null)
|
||||
readDataTimer.Start();
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
@@ -200,6 +202,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
|
||||
readDataTimer.Stop();
|
||||
readDataTimer.Dispose();
|
||||
readDataTimer = null;
|
||||
|
||||
foreach (var item in DiagramViewModel.Items.OfType<LogicalGateItemViewModelBase>().OrderBy(p => p.OrderNumber).ToList())
|
||||
{
|
||||
|
||||
@@ -119,9 +119,16 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
|
||||
List<ToolBoxData> defaultToolBoxItems = new List<ToolBoxData>();
|
||||
defaultToolBoxItems.Add(new TextToolBoxData("", typeof(DefaultDesignerItemViewModel)));
|
||||
var blockitem = new TextToolBoxData("", typeof(BlockDesignerItemViewModel), 64, 32, new Size(130, 65));
|
||||
var blockitem = new TextToolBoxData("Block", typeof(BlockDesignerItemViewModel), 64, 32, desiredMinSize: new Size(130, 65));
|
||||
blockitem.ColorViewModel.FillColor.Color = Color.FromRgb(0x00, 0x2F, 0xA7);
|
||||
defaultToolBoxItems.Add(blockitem);
|
||||
var blockitem2 = new TextToolBoxData("Contain", typeof(BlockContainDesignerItemViewModel), 64, 32, desiredMinSize: new Size(130, 65));
|
||||
blockitem2.ColorViewModel.FillColor.Color = Color.FromRgb(0x00, 0x2F, 0xA7);
|
||||
defaultToolBoxItems.Add(blockitem2);
|
||||
var blockitem3 = new TextToolBoxData("ContainList", typeof(BlockContainListDesignerItemViewModel), 64, 32, desiredMinSize: new Size(130, 65));
|
||||
blockitem3.ColorViewModel.FillColor.Color = Color.FromRgb(0x00, 0x2F, 0xA7);
|
||||
defaultToolBoxItems.Add(blockitem3);
|
||||
|
||||
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "Default", ToolBoxItems = new ObservableCollection<ToolBoxData>(defaultToolBoxItems), IsExpanded = true });
|
||||
|
||||
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "Svg", ToolBoxItems = new ObservableCollection<ToolBoxData>() });
|
||||
|
||||
@@ -103,6 +103,9 @@
|
||||
<Button Margin="5" ToolTip="画板" Command="{Binding NewCommand}" CommandParameter="Drawing" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
|
||||
<Path Stretch="Uniform" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M9.75 20.85C11.53 20.15 11.14 18.22 10.24 17C9.35 15.75 8.12 14.89 6.88 14.06C6 13.5 5.19 12.8 4.54 12C4.26 11.67 3.69 11.06 4.27 10.94C4.86 10.82 5.88 11.4 6.4 11.62C7.31 12 8.21 12.44 9.05 12.96L10.06 11.26C8.5 10.23 6.5 9.32 4.64 9.05C3.58 8.89 2.46 9.11 2.1 10.26C1.78 11.25 2.29 12.25 2.87 13.03C4.24 14.86 6.37 15.74 7.96 17.32C8.3 17.65 8.71 18.04 8.91 18.5C9.12 18.94 9.07 18.97 8.6 18.97C7.36 18.97 5.81 18 4.8 17.36L3.79 19.06C5.32 20 7.88 21.47 9.75 20.85M20.84 5.25C21.06 5.03 21.06 4.67 20.84 4.46L19.54 3.16C19.33 2.95 18.97 2.95 18.76 3.16L17.74 4.18L19.82 6.26M11 10.92V13H13.08L19.23 6.85L17.15 4.77L11 10.92Z" ></Path>
|
||||
</Button>
|
||||
<Button Margin="5" ToolTip="Stratch" Command="{Binding NewCommand}" CommandParameter="Block" Width="80" Height="80" Foreground="{DynamicResource BlackBrush}" Background="{DynamicResource WhiteBrush}" BorderBrush="{DynamicResource BlackBrush}">
|
||||
<Path Stretch="Uniform" Margin="20" Fill="{DynamicResource GrayBrush2}" Data="M884.48 296.106667l-5.973333-10.666667a90.88 90.88 0 0 0-31.146667-29.44l-201.386667-116.48a85.333333 85.333333 0 0 0-42.666666-11.52h-11.946667a81.92 81.92 0 0 0-42.666667 11.52L176.64 354.986667a85.333333 85.333333 0 0 0-31.146667 31.146666l-5.973333 10.666667a85.333333 85.333333 0 0 0-11.52 42.666667v245.76a85.333333 85.333333 0 0 0 11.52 42.666666l5.973333 10.666667a90.88 90.88 0 0 0 31.146667 31.146667l201.386667 114.773333a85.333333 85.333333 0 0 0 42.666666 11.52h11.946667a81.92 81.92 0 0 0 42.666667-11.52l372.053333-215.466667a85.333333 85.333333 0 0 0 31.146667-31.146666l5.973333-10.666667a85.333333 85.333333 0 0 0 11.52-42.666667V338.773333a85.333333 85.333333 0 0 0-11.52-42.666666zM591.36 213.333333h11.946667L768 307.2l-341.333333 197.546667-170.666667-97.28z m213.333333 384L469.333333 789.333333v-210.346666l341.333334-197.973334v203.52z" ></Path>
|
||||
</Button>
|
||||
</WrapPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="思维导图" >
|
||||
@@ -2651,70 +2654,76 @@
|
||||
</dragablz:TabablzControl.HeaderItemTemplate>
|
||||
<dragablz:TabablzControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<dd:DiagramTabControl ItemsSource="{Binding DiagramViewModels}" SelectedItem="{Binding DiagramViewModel}" Style="{StaticResource TabControlStyle}"
|
||||
<Grid>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Loaded" >
|
||||
<i:CallMethodAction MethodName="View_Loaded" TargetObject="{Binding}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<dd:DiagramTabControl ItemsSource="{Binding DiagramViewModels}" SelectedItem="{Binding DiagramViewModel}" Style="{StaticResource TabControlStyle}"
|
||||
BorderThickness="0" Margin="0" Padding="0">
|
||||
<TabControl.ItemContainerStyle>
|
||||
<Style>
|
||||
<Setter Property="TabItem.Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</TabControl.ItemContainerStyle>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<ScrollViewer x:Name="designerScrollViewer"
|
||||
<TabControl.ItemContainerStyle>
|
||||
<Style>
|
||||
<Setter Property="TabItem.Visibility" Value="Collapsed"/>
|
||||
</Style>
|
||||
</TabControl.ItemContainerStyle>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<ScrollViewer x:Name="designerScrollViewer"
|
||||
Background="{DynamicResource GrayBrush8}"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Focusable="False">
|
||||
<DockPanel x:Name="panel">
|
||||
<controls:Ruler x:Name="hruler"
|
||||
<DockPanel x:Name="panel">
|
||||
<controls:Ruler x:Name="hruler"
|
||||
Unit="{Binding DiagramOption.LayoutOption.PageUnit,Converter={StaticResource RulerUnitConverter}}"
|
||||
DockPanel.Dock="Top"
|
||||
Margin="21,0,0,0"
|
||||
Zoom="{Binding ZoomValue}"
|
||||
AutoSize="True"
|
||||
ClipToBounds="True" >
|
||||
<controls:Ruler.CountShift>
|
||||
<MultiBinding Converter="{StaticResource CountShiftConverter}" ConverterParameter="X">
|
||||
<Binding ElementName="diagram" Path="." />
|
||||
<Binding Path="DelayZoomValue"/>
|
||||
<Binding Path="DiagramOption.LayoutOption.PageUnit"/>
|
||||
<Binding ElementName="designerScrollViewer" Path="ActualWidth"/>
|
||||
<Binding ElementName="panel" Path="ActualWidth"/>
|
||||
<Binding ElementName="diagram" Path="ActualWidth"/>
|
||||
</MultiBinding>
|
||||
</controls:Ruler.CountShift>
|
||||
</controls:Ruler>
|
||||
<controls:Ruler x:Name="vruler"
|
||||
<controls:Ruler.CountShift>
|
||||
<MultiBinding Converter="{StaticResource CountShiftConverter}" ConverterParameter="X">
|
||||
<Binding ElementName="diagram" Path="." />
|
||||
<Binding Path="DelayZoomValue"/>
|
||||
<Binding Path="DiagramOption.LayoutOption.PageUnit"/>
|
||||
<Binding ElementName="designerScrollViewer" Path="ActualWidth"/>
|
||||
<Binding ElementName="panel" Path="ActualWidth"/>
|
||||
<Binding ElementName="diagram" Path="ActualWidth"/>
|
||||
</MultiBinding>
|
||||
</controls:Ruler.CountShift>
|
||||
</controls:Ruler>
|
||||
<controls:Ruler x:Name="vruler"
|
||||
Unit="{Binding DiagramOption.LayoutOption.PageUnit,Converter={StaticResource RulerUnitConverter}}"
|
||||
Marks="Up"
|
||||
RenderTransformOrigin="0,0"
|
||||
AutoSize="True"
|
||||
Zoom="{Binding ZoomValue}"
|
||||
ClipToBounds="True">
|
||||
<controls:Ruler.LayoutTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
<SkewTransform AngleX="0" AngleY="0" />
|
||||
<RotateTransform Angle="90" />
|
||||
<TranslateTransform X="23" />
|
||||
</TransformGroup>
|
||||
</controls:Ruler.LayoutTransform>
|
||||
<controls:Ruler.CountShift>
|
||||
<MultiBinding Converter="{StaticResource CountShiftConverter}" ConverterParameter="Y">
|
||||
<Binding ElementName="diagram" Path="." />
|
||||
<Binding Path="DelayZoomValue"/>
|
||||
<Binding Path="DiagramOption.LayoutOption.PageUnit"/>
|
||||
<Binding ElementName="designerScrollViewer" Path="ActualHeight"/>
|
||||
<Binding ElementName="panel" Path="ActualHeight"/>
|
||||
<Binding ElementName="diagram" Path="ActualHeight"/>
|
||||
</MultiBinding>
|
||||
</controls:Ruler.CountShift>
|
||||
</controls:Ruler>
|
||||
<dd:DiagramControl x:Name="diagram" DataContext="{Binding .}" Margin="50"/>
|
||||
</DockPanel>
|
||||
</ScrollViewer>
|
||||
<dd:ZoomBox x:Name="zoomBox"
|
||||
<controls:Ruler.LayoutTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
<SkewTransform AngleX="0" AngleY="0" />
|
||||
<RotateTransform Angle="90" />
|
||||
<TranslateTransform X="23" />
|
||||
</TransformGroup>
|
||||
</controls:Ruler.LayoutTransform>
|
||||
<controls:Ruler.CountShift>
|
||||
<MultiBinding Converter="{StaticResource CountShiftConverter}" ConverterParameter="Y">
|
||||
<Binding ElementName="diagram" Path="." />
|
||||
<Binding Path="DelayZoomValue"/>
|
||||
<Binding Path="DiagramOption.LayoutOption.PageUnit"/>
|
||||
<Binding ElementName="designerScrollViewer" Path="ActualHeight"/>
|
||||
<Binding ElementName="panel" Path="ActualHeight"/>
|
||||
<Binding ElementName="diagram" Path="ActualHeight"/>
|
||||
</MultiBinding>
|
||||
</controls:Ruler.CountShift>
|
||||
</controls:Ruler>
|
||||
<dd:DiagramControl x:Name="diagram" DataContext="{Binding .}" Margin="50"/>
|
||||
</DockPanel>
|
||||
</ScrollViewer>
|
||||
<dd:ZoomBox x:Name="zoomBox"
|
||||
Width="180"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Bottom"
|
||||
@@ -2725,10 +2734,11 @@
|
||||
ZoomValue="{Binding ZoomValue,Mode=TwoWay}"
|
||||
FitViewModel="{Binding FitViewModel}"
|
||||
Margin="20,0,0,20" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
</dd:DiagramTabControl>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
</dd:DiagramTabControl>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</dragablz:TabablzControl.ContentTemplate>
|
||||
</dragablz:TabablzControl>
|
||||
|
||||
Reference in New Issue
Block a user