MainWindow.xaml 7.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <Window x:Class="pageedit_ctrl_demo.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:pageedit_ctrl_demo"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9. <Window.Resources>
  10. <ResourceDictionary>
  11. <ResourceDictionary.MergedDictionaries>
  12. <ResourceDictionary Source="pack://application:,,,/compdfkit-assets;component/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
  13. <ResourceDictionary Source="pack://application:,,,/compdfkit-assets;component/Styles/ButtonStyle.xaml"></ResourceDictionary>
  14. </ResourceDictionary.MergedDictionaries>
  15. </ResourceDictionary>
  16. </Window.Resources>
  17. <Grid>
  18. <Grid>
  19. <Grid.RowDefinitions>
  20. <RowDefinition Height="40"></RowDefinition>
  21. <RowDefinition Height="*"></RowDefinition>
  22. </Grid.RowDefinitions>
  23. <Grid>
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="auto"></ColumnDefinition>
  26. <ColumnDefinition Width="*"></ColumnDefinition>
  27. <ColumnDefinition Width="auto"></ColumnDefinition>
  28. </Grid.ColumnDefinitions>
  29. <Grid>
  30. <StackPanel Orientation="Horizontal">
  31. <!--打开文件-->
  32. <Button BorderThickness="0" VerticalContentAlignment="Center" Width="30" Height="30" Style="{StaticResource LightButtonStyle}" Background="Transparent" Click="OpenFile_Click">
  33. <Button.Content>
  34. <Viewbox Width="20" Height="20">
  35. <Path Fill="#43474D" >
  36. <Path.Data>
  37. M3.75,2 L3.91967773,2.00463867 C4.08325195,2.01391602 4.22851562,2.03710938 4.35546875,2.07421875 C4.52473958,2.12369792
  38. 4.67578125,2.18489583 4.80859375,2.2578125 C4.94140625,2.33072917 5.05989583,2.41145833 5.1640625,2.5 C5.26822917,2.58854167
  39. 5.37369792,2.66927083 5.48046875,2.7421875 C5.58723958,2.81510417 5.70182292,2.87630208 5.82421875,2.92578125 C5.94661458,2.97526042
  40. 6.08854167,3 6.25,3 L6.25,3 L12,3 L12.1371528,3.00868056 C12.2262731,3.02025463 12.3107639,3.04340278 12.390625,3.078125
  41. C12.5104167,3.13020833 12.6158854,3.20182292 12.7070312,3.29296875 C12.7981771,3.38411458 12.8697917,3.48958333 12.921875,3.609375
  42. C12.9739583,3.72916667 13,3.859375 13,4 L13,4 L13,6 L15,6 L15.1332465,6.00868056 C15.2206308,6.02025463 15.3051215,6.04340278
  43. 15.3867188,6.078125 C15.5091146,6.13020833 15.6158854,6.20182292 15.7070312,6.29296875 C15.7981771,6.38411458 15.8697917,6.48958333
  44. 15.921875,6.609375 C15.9739583,6.72916667 16,6.85677083 16,6.9921875 C16,7.1484375 15.9635417,7.29947917 15.890625,7.4453125
  45. L15.890625,7.4453125 L12.6171875,14 L0,14 L0,3 L0.00868055556,2.86284722 C0.0202546296,2.77372685 0.0434027778,2.68923611 0.078125,2.609375
  46. C0.130208333,2.48958333 0.201822917,2.38411458 0.29296875,2.29296875 C0.384114583,2.20182292 0.489583333,2.13020833 0.609375,2.078125
  47. C0.729166667,2.02604167 0.859375,2 1,2 L1,2 L3.75,2 Z M15,7 L4.3125,7 L1.3125,13 L12,13 L15,7 Z M3.75,3 L1,3 L1,11.3828125 L3.4140625,6.5546875
  48. L3.48706055,6.43261719 C3.56665039,6.31738281 3.66601562,6.22265625 3.78515625,6.1484375 C3.94401042,6.04947917 4.11979167,6 4.3125,6
  49. L4.3125,6 L12,6 L12,4 L6.25,4 L6.08032227,3.99536133 C5.91674805,3.98608398 5.77148438,3.96289062 5.64453125,3.92578125 C5.47526042,3.87630208
  50. 5.32421875,3.81510417 5.19140625,3.7421875 C5.05859375,3.66927083 4.94010417,3.58854167 4.8359375,3.5 C4.73177083,3.41145833 4.62630208,3.33072917
  51. 4.51953125,3.2578125 C4.41276042,3.18489583 4.29817708,3.12369792 4.17578125,3.07421875 C4.05338542,3.02473958 3.91145833,3 3.75,3 L3.75,3 Z
  52. </Path.Data>
  53. </Path>
  54. </Viewbox>
  55. </Button.Content>
  56. </Button>
  57. <!--保存文件-->
  58. <Button BorderThickness="0" VerticalContentAlignment="Center" Margin="10,0,0,0" Width="30" Height="30" Style="{StaticResource LightButtonStyle}" Background="Transparent"
  59. Click="SaveFileBtn_Click" IsEnabled="{Binding CanSave,Mode=OneWay}">
  60. <Button.Content>
  61. <Viewbox Width="20" Height="20">
  62. <Path IsEnabled="{Binding CanSave,Mode=OneWay}">
  63. <Path.Style>
  64. <Style TargetType="Path">
  65. <Style.Triggers>
  66. <Trigger Property="IsEnabled" Value="False">
  67. <Setter Property="Fill" Value="LightGray"/>
  68. </Trigger>
  69. <Trigger Property="IsEnabled" Value="True">
  70. <Setter Property="Fill" Value="#43474D"/>
  71. </Trigger>
  72. </Style.Triggers>
  73. </Style>
  74. </Path.Style>
  75. <Path.Data>
  76. M11.707107,1 L15,4.29289322 L15,15 L1,15 L1,1 L11.707107,1 Z M11.293,2 L2,2 L2,14 L4,14 L4,8 L12,8 L12,14 L14,14 L14,4.707 L11.293,2 Z
  77. M11,9 L5,9 L5,14 L11,14 L11,9 Z M7,5 L7,6 L4,6 L4,5 L7,5 Z
  78. </Path.Data>
  79. </Path>
  80. </Viewbox>
  81. </Button.Content>
  82. </Button>
  83. <!--工具栏展开收缩-->
  84. <ToggleButton Name="ToolExpandBtn" Margin="13,0,0,0" BorderThickness="0" Width="30" Height="30" Style="{StaticResource ToggleButtonStyle}" Background="Transparent" Click="ToolExpandBtn_Click"/>
  85. </StackPanel>
  86. </Grid>
  87. </Grid>
  88. </Grid>
  89. </Grid>
  90. </Window>