MainWindow.xaml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <Window x:Class="viewer_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:viewer_ctrl_demo"
  7. xmlns:cpdftools="clr-namespace:compdfkit_tools.PDFControl;assembly=com.compdfkit.tools"
  8. mc:Ignorable="d"
  9. Title="MainWindow" Height="960" Width="1280" WindowStartupLocation="CenterScreen">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="40"></RowDefinition>
  13. <RowDefinition></RowDefinition>
  14. <RowDefinition Height="40"></RowDefinition>
  15. </Grid.RowDefinitions>
  16. <cpdftools:TitleBarControl x:Name="TitleBarControl" Grid.ColumnSpan="2"></cpdftools:TitleBarControl>
  17. <Grid Name="BodyGrid" Grid.Row="1">
  18. <Grid.ColumnDefinitions>
  19. <ColumnDefinition Width="40"></ColumnDefinition>
  20. <ColumnDefinition Width="0"></ColumnDefinition>
  21. <ColumnDefinition Width="auto"></ColumnDefinition>
  22. <ColumnDefinition Width="*"></ColumnDefinition>
  23. <ColumnDefinition Width="auto"></ColumnDefinition>
  24. </Grid.ColumnDefinitions>
  25. <!--左侧工具栏-->
  26. <StackPanel Name="BotaSideTool" Grid.Column="0" Background="{StaticResource color.bg.jumpbar}" Orientation="Vertical">
  27. <!--文字搜索-->
  28. <ToggleButton Name="SearchToolButton" Height="40" Padding="0,5,0,5" BorderThickness="0" Background="{StaticResource color.bg.jumpbar}" Click="SearchToolButton_Click">
  29. <ToggleButton.Content>
  30. <Path Width="20" Height="20" Fill="#273C62">
  31. <Path.Data>
  32. M14 8.5C14 11.5376 11.5376 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3C11.5376 3 14 5.46243 14 8.5ZM13.0492 14.4633C11.7874 15.4274
  33. 10.2106 16 8.5 16C4.35786 16 1 12.6421 1 8.5C1 4.35786 4.35786 1 8.5 1C12.6421 1 16 4.35786 16 8.5C16 10.2105 15.4274 11.7873 14.4634 13.0491L18.4572
  34. 17.0429L17.043 18.4571L13.0492 14.4633Z
  35. </Path.Data>
  36. </Path>
  37. </ToggleButton.Content>
  38. </ToggleButton>
  39. <!--缩略图-->
  40. <ToggleButton Name="ThumbToolButton" Height="40" Padding="0,5,0,5" BorderThickness="0" Background="{StaticResource color.bg.jumpbar}" Click="ThumbToolButton_Click">
  41. <ToggleButton.Content>
  42. <Path Width="20" Height="20" Fill="#273C62">
  43. <Path.Data>
  44. M15 9V17H5L5 3L9 3V7C9 8.10457 9.89543 9 11 9H15ZM14.1716 7H11V3.82843L12.5858 5.41421L14.1716 7ZM17 8V17C17 18.1046 16.1046 19 15 19H5C3.89543 19 3
  45. 18.1046 3 17V3C3 1.89543 3.89543 1 5 1H10H10.1716C10.702 1 11.2107 1.21071 11.5858 1.58579L14 4L16.4142 6.41421C16.7893 6.78929 17 7.29799 17 7.82843V8Z
  46. </Path.Data>
  47. </Path>
  48. </ToggleButton.Content>
  49. </ToggleButton>
  50. <ToggleButton Name="OutlineToolButton" Height="40" Padding="0,5,0,5" BorderThickness="0" Background="{StaticResource color.bg.jumpbar}" Click="OutlineToolButton_Click">
  51. <ToggleButton.Content>
  52. <Path Width="20" Height="20" Fill="#273C62">
  53. <Path.Data>
  54. M5,14.375 L5,18.125 L1.25,18.125 L1.25,14.375 L5,14.375 Z M18.75,15.625 L18.75,16.875 L7.5,16.875 L7.5,15.625 L18.75,15.625 Z M5,8.125 L5,11.875 L1.25,11.875 L1.25,8.125 L5,8.125 Z M18.75,9.375 L18.75,10.625 L7.5,10.625 L7.5,9.375 L18.75,9.375 Z M5,1.875 L5,5.625 L1.25,5.625 L1.25,1.875 L5,1.875 Z M18.75,3.125 L18.75,4.375 L7.5,4.375 L7.5,3.125 L18.75,3.125 Z
  55. </Path.Data>
  56. </Path>
  57. </ToggleButton.Content>
  58. </ToggleButton>
  59. <!--书签-->
  60. <ToggleButton Name="BookmarkToolButton" Height="40" Padding="0,5,0,5" BorderThickness="0" Background="{StaticResource color.bg.jumpbar}" Click="BookmarkToolButtonn_Click">
  61. <ToggleButton.Content>
  62. <Path Width="20" Height="20" Fill="#273C62">
  63. <Path.Data>
  64. M11.3793 12.8851C10.6069 12.1494 9.3931 12.1494 8.62069 12.8851L5 16.3333V3H15V16.3333L11.3793 12.8851ZM15.3103 19.3908L10 14.3333L4.68966
  65. 19.3908C4.053 19.9971 3 19.5459 3 18.6667V3C3 1.89543 3.89543 1 5 1H15C16.1046 1 17 1.89543 17 3V18.6667C17 19.5459 15.947 19.9971
  66. 15.3103 19.3908ZM7 5H8H12H13V6V7H12H8H7V6V5Z
  67. </Path.Data>
  68. </Path>
  69. </ToggleButton.Content>
  70. </ToggleButton>
  71. <ToggleButton Name="BotaButton" Height="40" Padding="0,5,0,5" BorderThickness="0" Background="{StaticResource color.bg.jumpbar}" Click="BotaButton_Click">
  72. <ToggleButton.Content>
  73. <Path Width="20" Height="20" Fill="#273C62">
  74. <Path.Data>
  75. M11.3793 12.8851C10.6069 12.1494 9.3931 12.1494 8.62069 12.8851L5 16.3333V3H15V16.3333L11.3793 12.8851ZM15.3103 19.3908L10 14.3333L4.68966
  76. 19.3908C4.053 19.9971 3 19.5459 3 18.6667V3C3 1.89543 3.89543 1 5 1H15C16.1046 1 17 1.89543 17 3V18.6667C17 19.5459 15.947 19.9971
  77. 15.3103 19.3908ZM7 5H8H12H13V6V7H12H8H7V6V5Z
  78. </Path.Data>
  79. </Path>
  80. </ToggleButton.Content>
  81. </ToggleButton>
  82. </StackPanel>
  83. <!--工具栏展开-->
  84. <Border Name="BotaToolContainer" Grid.Column="1" BorderThickness="0,0,1,0" BorderBrush="Gray" Visibility="Collapsed"></Border>
  85. <!--拖动调节控件大小-->
  86. <GridSplitter Name="Splitter" Grid.Column="2" Width="15" ResizeBehavior="PreviousAndNext" Visibility="Collapsed">
  87. <GridSplitter.Template>
  88. <ControlTemplate TargetType="{x:Type GridSplitter}">
  89. <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
  90. BorderBrush="{TemplateBinding Border.BorderBrush}"
  91. Background="{TemplateBinding Panel.Background}" >
  92. <Path Fill="Gray" VerticalAlignment="Center">
  93. <Path.Data>
  94. M15 3.75H1V2.25H15V3.75ZM15 8.75H1V7.25H15V8.75ZM1 13.75H15V12.25H1V13.75Z
  95. </Path.Data>
  96. </Path>
  97. </Border>
  98. </ControlTemplate>
  99. </GridSplitter.Template>
  100. </GridSplitter>
  101. <!--PDFViewer-->
  102. <Border Grid.Column="3" x:Name="PDFGrid" Background="{StaticResource color.bg.mainpage}"> </Border>
  103. <!--右侧面板-->
  104. <Grid Grid.Column="4" Visibility="Hidden"></Grid>
  105. </Grid>
  106. <!--底部工具栏-->
  107. <Grid Grid.Row="2" Background="#FFFFFF">
  108. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  109. <Rectangle Width="1" Fill="#AAAAAA" Margin="5,0,5,0"></Rectangle>
  110. <cpdftools:CPDFPageTurningControl x:Name="CPDFPageTurningControl"/>
  111. <Rectangle Width="1" Fill="#AAAAAA" Margin="5,0,5,0"></Rectangle>
  112. <cpdftools:CPDFScalingControl x:Name="CPDFScalingControl"/>
  113. <Rectangle Width="1" Fill="#AAAAAA" Margin="5,0,5,0"></Rectangle>
  114. <cpdftools:CPDFViewModeControl x:Name="CPDFViewModeControl"/>
  115. <Rectangle Width="1" Fill="#AAAAAA" Margin="5,0,5,0"></Rectangle>
  116. <cpdftools:CPDFDrawModeControl x:Name="CPDFDrawModeControl"/>
  117. <Rectangle Width="1" Fill="#AAAAAA" Margin="5,0,5,0"></Rectangle>
  118. <Button x:Name="PDFInfoButton" Height="30" Width="60" Click="PDFInfoButton_Click">
  119. <TextBlock Text="文档属性"></TextBlock>
  120. </Button>
  121. <Rectangle Width="1" Fill="#AAAAAA" Margin="5,0,5,0"></Rectangle>
  122. </StackPanel>
  123. <Border BorderBrush="{StaticResource color.border.normal}" BorderThickness="1"></Border>
  124. </Grid>
  125. </Grid>
  126. </Window>