Bladeren bron

compdfkit(win) - 打印翻页样式补充

youna 8 maanden geleden
bovenliggende
commit
661ec0f2ff

+ 1 - 1
Demo/Examples/Compdfkit.Controls/Common/BarControl/CPDFTitleBarControl.xaml

@@ -39,7 +39,7 @@
                         <MenuItem Header="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=HelpMenu_DeviceID}" Style="{StaticResource Sub_MenuItem}" Click="DeviceSerial_Click"></MenuItem>
                     </MenuItem>
 
-                    <MenuItem Header="Print" Style="{StaticResource Dropdown_MenuItem}" Click="PrintItem_Click"></MenuItem>
+                    <MenuItem Header="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Print}" Style="{StaticResource Dropdown_MenuItem}" Click="PrintItem_Click"></MenuItem>
                 </Menu>
 
                 <Menu 

+ 80 - 3
Demo/Examples/Compdfkit.Controls/Printer/PrintPreviewControl.xaml

@@ -6,7 +6,82 @@
              xmlns:local="clr-namespace:ComPDFKit.Controls.PDFControl"
              mc:Ignorable="d" 
              d:DesignHeight="360" d:DesignWidth="240" Background="#F7F8FA">
-    <Grid>
+    <UserControl.Resources>
+        <Style x:Key="PrePageBtnStyle" TargetType="Button">
+            <Setter Property="Height" Value="24" />
+            <Setter Property="Width" Value="24" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Grid x:Name="UserfulRegion">
+                            <Border
+                                x:Name="border"
+                                BorderBrush="#5A000000"
+                                BorderThickness="1"
+                                CornerRadius="4">
+                                <Grid>
+                                    <Rectangle
+                                        Width="24"
+                                        Height="24"
+                                        Fill="Transparent" />
+                                    <Path
+                                        x:Name="Path"
+                                        Width="24"
+                                        Height="24"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        Data="M10.0607 12.1L14.6303 7.53039L13.5696 6.46973L8.46967 11.5697C8.17678 11.8626 8.17678 12.3374 8.46967 12.6303L13.5696 17.7303L14.6303 16.6696L10.0607 12.1Z"
+                                        Fill="#8A000000" />
+                                </Grid>
+                            </Border>
+                        </Grid>
+                        <ControlTemplate.Triggers>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter TargetName="border" Property="Background" Value="#cccccc" />
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <Style x:Key="NextPageBtnStyle" TargetType="Button">
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Grid x:Name="UserfulRegion">
+                            <Border
+                                x:Name="border"
+                                BorderBrush="#5A000000"
+                                BorderThickness="1"
+                                CornerRadius="4">
+                                <Grid>
+
+                                    <Rectangle
+                                        Width="24"
+                                        Height="24"
+                                        Fill="Transparent" />
+                                    <Path
+                                        x:Name="Path"
+                                        Width="24"
+                                        Height="24"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        Data="M13.9393 12.1L9.36972 7.53039L10.4304 6.46973L15.5303 11.5697C15.8232 11.8626 15.8232 12.3374 15.5303 12.6303L10.4304 17.7303L9.36972 16.6696L13.9393 12.1Z"
+                                        Fill="#8A000000" />
+                                </Grid>
+                            </Border>
+                        </Grid>
+                        <ControlTemplate.Triggers>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter TargetName="border" Property="Background" Value="#cccccc" />
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+    </UserControl.Resources>
+        <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="20"></RowDefinition>
             <RowDefinition></RowDefinition>
@@ -26,11 +101,13 @@
             </Viewbox> 
         </Grid>
         <StackPanel Grid.Row="2" HorizontalAlignment="Center" Orientation="Horizontal">
-            <Button x:Name="btnPreButton" Height="32" Width="36" Margin="0,0,12,0" Click="btnPreButton_Click"></Button>
+            <Button x:Name="btnPreButton" Height="32" Width="36" Style="{StaticResource PrePageBtnStyle}" Margin="0,0,12,0" Click="btnPreButton_Click">
+                
+            </Button>
             <TextBox x:Name="txbPageIndex" Height="32" Width="50" Text="{Binding PaperIndex, UpdateSourceTrigger=PropertyChanged}" LostFocus="txbPageIndex_LostFocus" PreviewLostKeyboardFocus="txbPageIndex_PreviewLostKeyboardFocus" TextAlignment="Center" VerticalContentAlignment="Center"></TextBox>
             <TextBlock Text=" of " VerticalAlignment="Center"></TextBlock>
             <TextBlock  Text="{Binding PrintedPageCount}"  VerticalAlignment="Center"></TextBlock>
-            <Button x:Name="btnNextButton" Height="32" Width="36"  Margin="12,0,0,0" Click="btnNextButton_Click"></Button>
+            <Button x:Name="btnNextButton" Style="{StaticResource NextPageBtnStyle}" Height="32" Width="36"  Margin="12,0,0,0" Click="btnNextButton_Click"></Button>
         </StackPanel>
     </Grid>
 </UserControl>

+ 9 - 0
Demo/Examples/Compdfkit.Controls/Strings/Common.Designer.cs

@@ -987,6 +987,15 @@ namespace ComPDFKit.Controls.Strings {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Print.
+        /// </summary>
+        internal static string Printer_Print {
+            get {
+                return ResourceManager.GetString("Printer_Print", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Printer.
         /// </summary>

+ 3 - 0
Demo/Examples/Compdfkit.Controls/Strings/Common.resx

@@ -588,4 +588,7 @@
   <data name="Printer_Size" xml:space="preserve">
     <value>Size</value>
   </data>
+  <data name="Printer_Print" xml:space="preserve">
+    <value>Print</value>
+  </data>
 </root>

+ 3 - 0
Demo/Examples/Compdfkit.Controls/Strings/Common.zh.resx

@@ -588,4 +588,7 @@
   <data name="Printer_Size" xml:space="preserve">
     <value>大小模式</value>
   </data>
+  <data name="Printer_Print" xml:space="preserve">
+    <value>打印</value>
+  </data>
 </root>