QuoteDiagramControl.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <UserControl x:Class="PRSDesktop.QuoteDiagramControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PRSDesktop"
  7. xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
  8. xmlns:diagram="clr-namespace:Syncfusion.UI.Xaml.Diagram;assembly=Syncfusion.SfDiagram.WPF"
  9. xmlns:stencil="clr-namespace:Syncfusion.UI.Xaml.Diagram.Stencil;assembly=Syncfusion.SfDiagram.WPF"
  10. xmlns:dynamicGrid="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
  11. mc:Ignorable="d"
  12. d:DesignHeight="450" d:DesignWidth="800" Background="Black">
  13. <UserControl.Resources>
  14. <ResourceDictionary>
  15. <ResourceDictionary.MergedDictionaries>
  16. <ResourceDictionary Source="/Syncfusion.SfDiagram.Wpf;component/Resources/BasicShapes.xaml" />
  17. </ResourceDictionary.MergedDictionaries>
  18. <!--Style for Node-->
  19. <!--<Style TargetType="diagram:Node">
  20. <Setter Property="ShapeStyle">
  21. <Setter.Value>
  22. <Style TargetType="Path">
  23. <Setter Property="Stretch" Value="Fill"></Setter>
  24. <Setter Property="Fill" Value="#FF5B9BD5"></Setter>
  25. </Style>
  26. </Setter.Value>
  27. </Setter>
  28. </Style>-->
  29. <!--Style for Connector--><!--
  30. <Style TargetType="diagram:Connector">
  31. <Setter Property="TargetDecoratorStyle">
  32. <Setter.Value>
  33. <Style TargetType="Path">
  34. <Setter Property="Stretch" Value="Fill"/>
  35. <Setter Property="Fill" Value="Black"/>
  36. <Setter Property="Stroke" Value="Black"/>
  37. <Setter Property="StrokeThickness" Value="1"/>
  38. </Style>
  39. </Setter.Value>
  40. </Setter>
  41. <Setter Property="ConnectorGeometryStyle">
  42. <Setter.Value>
  43. <Style TargetType="Path">
  44. <Setter Property="Stretch" Value="Fill"/>
  45. <Setter Property="Fill" Value="Black"/>
  46. <Setter Property="Stroke" Value="Black"/>
  47. <Setter Property="StrokeThickness" Value="1"/>
  48. </Style>
  49. </Setter.Value>
  50. </Setter>
  51. </Style>-->
  52. <!--Style for Symbol-->
  53. <Style TargetType="stencil:Symbol">
  54. <Setter Property="ToolTip" Value="{Binding Symbol}" />
  55. <Setter Property="Width" Value="75" />
  56. <Setter Property="Height" Value="75" />
  57. <Setter Property="Padding" Value="2" />
  58. <Setter Property="BorderThickness" Value="0.75" />
  59. <Setter Property="Background" Value="WhiteSmoke" />
  60. <Setter Property="BorderBrush" Value="Gray" />
  61. <Setter Property="Margin" Value="2" />
  62. </Style>
  63. <!--Style for Symbol Group-->
  64. <!--<Style TargetType="stencil:SymbolGroup">
  65. <Setter Property="FontFamily" Value="Regular"/>
  66. <Setter Property="Background" Value="#ffffff"/>
  67. <Setter Property="Foreground" Value="#222222"/>
  68. <Setter Property="FontSize" Value="14"/>
  69. <Setter Property="HeaderTemplate">
  70. <Setter.Value>
  71. <DataTemplate>
  72. <stencil:Header>
  73. <stencil:Header.Template>
  74. <ControlTemplate TargetType="stencil:Header">
  75. <Grid>
  76. <Border x:Name="header" Background="#f5f5f5"
  77. BorderBrush="Black" BorderThickness="1">
  78. <ContentPresenter Margin="10" Content="{Binding}"/>
  79. </Border>
  80. </Grid>
  81. </ControlTemplate>
  82. </stencil:Header.Template>
  83. </stencil:Header>
  84. </DataTemplate>
  85. </Setter.Value>
  86. </Setter>
  87. </Style>-->
  88. <ControlTemplate x:Key="VerticalSplitter">
  89. <Grid Background="{TemplateBinding Background}" Width="4">
  90. <Button x:Name="PART_Left" Visibility="Collapsed" />
  91. <Button x:Name="PART_Right" Visibility="Collapsed" />
  92. <StackPanel Margin="0" Orientation="Vertical" VerticalAlignment="Center"
  93. HorizontalAlignment="Center">
  94. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1"
  95. Margin="0,2,0,0" />
  96. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1"
  97. Margin="0,2,0,0" />
  98. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1"
  99. Margin="0,2,0,0" />
  100. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1"
  101. Margin="0,2,0,0" />
  102. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1"
  103. Margin="0,2,0,0" />
  104. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1"
  105. Margin="0,2,0,0" />
  106. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1"
  107. Margin="0,2,0,0" />
  108. </StackPanel>
  109. </Grid>
  110. </ControlTemplate>
  111. <DataTemplate x:Key="TitleTemplate">
  112. <DockPanel>
  113. <Button BorderThickness="0" Background="Transparent" Click="EditStencil_Click">
  114. <Image Source="pack://application:,,,/Resources/pencil.png" Width="24" Height="24"
  115. DockPanel.Dock="Left" />
  116. </Button>
  117. <TextBlock DockPanel.Dock="Left" Margin="5,0,0,0" HorizontalAlignment="Stretch"
  118. VerticalAlignment="Center" Text="{Binding}" FontSize="14" FontWeight="DemiBold" />
  119. </DockPanel>
  120. </DataTemplate>
  121. <ControlTemplate TargetType="{x:Type syncfusion:DiagramThumb}" x:Key="ResizerStyleTemplate">
  122. <Grid>
  123. <Rectangle Fill="Transparent" />
  124. <Border Height="2" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
  125. VerticalAlignment="{TemplateBinding VerticalAlignment}" Margin="0 -3 0 0"
  126. x:Name="PART_ReseizerThumb" CornerRadius="7" Background="{TemplateBinding Background}"
  127. BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" />
  128. <Rectangle x:Name="PART_ResizerBorder" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
  129. Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
  130. VerticalAlignment="{TemplateBinding VerticalAlignment}" Fill="Orange" Stroke="OrangeRed"
  131. StrokeThickness="1" Margin="7" />
  132. </Grid>
  133. </ControlTemplate>
  134. <Style x:Key="ResizerStyle" TargetType="{x:Type syncfusion:DiagramThumb}">
  135. <Setter Property="IsTabStop" Value="false" />
  136. <Setter Property="Background" Value="Orange" />
  137. <Setter Property="Width" Value="25" />
  138. <Setter Property="Height" Value="25" />
  139. <Setter Property="Margin" Value="0 -5 0 0" />
  140. <Setter Property="Opacity" Value="0.6" />
  141. <Setter Property="Template" Value="{StaticResource ResizerStyleTemplate}" />
  142. </Style>
  143. </ResourceDictionary>
  144. </UserControl.Resources>
  145. <Grid>
  146. <Grid.ColumnDefinitions>
  147. <ColumnDefinition Width="300" />
  148. <ColumnDefinition Width="4" />
  149. <ColumnDefinition Width="*" />
  150. </Grid.ColumnDefinitions>
  151. <Grid.RowDefinitions>
  152. <RowDefinition Height="Auto" />
  153. <RowDefinition Height="*" />
  154. </Grid.RowDefinitions>
  155. <dynamicGrid:DynamicTabControl x:Name="Stencils" TabStripPlacement="Bottom" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
  156. <dynamicGrid:DynamicTabItem Header="Areas" Padding="5,2">
  157. <stencil:Stencil
  158. x:Name="areas"
  159. DisplayMode="Expanded"
  160. ShowDisplayModeToggleButton="False"
  161. ExpandMode="OneOrMore"
  162. SymbolsDisplayMode="NamesUnderIcons"
  163. Title="Areas"
  164. TitleTemplate="{StaticResource TitleTemplate}">
  165. <stencil:Stencil.SymbolGroups>
  166. <stencil:SymbolGroups>
  167. <stencil:SymbolGroupProvider MappingName="Key" />
  168. </stencil:SymbolGroups>
  169. </stencil:Stencil.SymbolGroups>
  170. </stencil:Stencil>
  171. </dynamicGrid:DynamicTabItem>
  172. <dynamicGrid:DynamicTabItem Header="Symbols" Padding="5,2">
  173. <stencil:Stencil
  174. x:Name="symbols"
  175. DisplayMode="Expanded"
  176. ShowDisplayModeToggleButton="False"
  177. ExpandMode="OneOrMore"
  178. SymbolsDisplayMode="NamesUnderIcons"
  179. Title="Symbols"
  180. TitleTemplate="{StaticResource TitleTemplate}">
  181. <stencil:Stencil.SymbolGroups>
  182. <stencil:SymbolGroups>
  183. <stencil:SymbolGroupProvider MappingName="Key" />
  184. </stencil:SymbolGroups>
  185. </stencil:Stencil.SymbolGroups>
  186. </stencil:Stencil>
  187. </dynamicGrid:DynamicTabItem>
  188. <dynamicGrid:DynamicTabItem Header="Connectors" Padding="5,2">
  189. <stencil:Stencil
  190. x:Name="connectors"
  191. DisplayMode="Expanded"
  192. ShowDisplayModeToggleButton="False"
  193. ExpandMode="OneOrMore"
  194. SymbolsDisplayMode="NamesUnderIcons"
  195. Title="Connectors"
  196. TitleTemplate="{StaticResource TitleTemplate}">
  197. <stencil:Stencil.SymbolGroups>
  198. <stencil:SymbolGroups>
  199. <stencil:SymbolGroupProvider MappingName="Key" />
  200. </stencil:SymbolGroups>
  201. </stencil:Stencil.SymbolGroups>
  202. </stencil:Stencil>
  203. </dynamicGrid:DynamicTabItem>
  204. </dynamicGrid:DynamicTabControl>
  205. <syncfusion:SfGridSplitter Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" ResizeBehavior="PreviousAndNext"
  206. Width="4" Background="Transparent" Template="{StaticResource VerticalSplitter}">
  207. <syncfusion:SfGridSplitter.PreviewStyle>
  208. <Style TargetType="Control">
  209. <Setter Property="Background" Value="Gray" />
  210. <Setter Property="Template">
  211. <Setter.Value>
  212. <ControlTemplate TargetType="Control">
  213. <Grid x:Name="Root" Opacity="0.5">
  214. <Rectangle Fill="{TemplateBinding Background}" />
  215. </Grid>
  216. </ControlTemplate>
  217. </Setter.Value>
  218. </Setter>
  219. </Style>
  220. </syncfusion:SfGridSplitter.PreviewStyle>
  221. </syncfusion:SfGridSplitter>
  222. <Border BorderBrush="Gray" BorderThickness="0.75" Grid.Column="2" Grid.Row="0">
  223. <DockPanel Margin="2">
  224. <Button x:Name="ScaleButton" DockPanel.Dock="Left" Content="Scale" Click="ScaleButton_Click"
  225. Padding="10,0,10,0" />
  226. <TextBox x:Name="ScaleBox" DockPanel.Dock="Left" Text="1:100" Width="50" TextAlignment="Center"
  227. VerticalContentAlignment="Center" Margin="2,0,0,0" IsReadOnly="True" />
  228. <Button x:Name="TakeOff" DockPanel.Dock="Right" Content="Take Off" Padding="10,0,10,0"
  229. Click="TakeOff_Click" />
  230. <Slider x:Name="Zoom" DockPanel.Dock="Right" Minimum="25" Value="100" Maximum="400" Interval="1"
  231. ValueChanged="Zoom_ValueChanged" Width="100" VerticalAlignment="Center" />
  232. <Label Content="Zoom:" DockPanel.Dock="Right" VerticalContentAlignment="Center" />
  233. <Label DockPanel.Dock="Left" />
  234. </DockPanel>
  235. </Border>
  236. <local:CustomDiagram x:Name="diagram" Grid.Column="2" Grid.Row="1" Margin="0,2,0,0" BorderBrush="Gray"
  237. BorderThickness="0.75" Constraints="Default,Routing">
  238. <local:CustomDiagram.SnapSettings>
  239. <syncfusion:SnapSettings SnapConstraints="ShowLines" />
  240. </local:CustomDiagram.SnapSettings>
  241. <local:CustomDiagram.PageSettings>
  242. <syncfusion:PageSettings
  243. PageOrientation="Landscape"
  244. PageWidth="21.0"
  245. PageHeight="29.7"
  246. ShowPageBreaks="True"
  247. PrintMargin="0"
  248. MultiplePage="False" />
  249. </local:CustomDiagram.PageSettings>
  250. <local:CustomDiagram.HorizontalRuler>
  251. <syncfusion:Ruler />
  252. </local:CustomDiagram.HorizontalRuler>
  253. <local:CustomDiagram.VerticalRuler>
  254. <syncfusion:Ruler Orientation="Vertical" />
  255. </local:CustomDiagram.VerticalRuler>
  256. <local:CustomDiagram.ScrollSettings>
  257. <syncfusion:ScrollSettings ScrollLimit="Diagram" />
  258. </local:CustomDiagram.ScrollSettings>
  259. </local:CustomDiagram>
  260. </Grid>
  261. </UserControl>