ReadModeContent.xaml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <UserControl
  2. x:Class="PDF_Office.Views.PropertyPanel.ViewModular.ReadModeContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:ViewModular="clr-namespace:PDF_Office.ViewModels.PropertyPanel.ViewModular"
  6. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:converter="clr-namespace:PDF_Office.DataConvert"
  8. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  9. xmlns:helper="clr-namespace:PDF_Office.Helper"
  10. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  11. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.ViewModular"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:prism="http://prismlibrary.com/"
  14. x:Name="ReadMode"
  15. Width="auto"
  16. d:DataContext="{d:DesignInstance Type=ViewModular:ReadModeContentViewModel}"
  17. d:DesignHeight="44"
  18. d:DesignWidth="230"
  19. Background="#CC000000"
  20. mc:Ignorable="d">
  21. <UserControl.Resources>
  22. <ResourceDictionary>
  23. <ResourceDictionary.MergedDictionaries>
  24. <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
  25. </ResourceDictionary.MergedDictionaries>
  26. <convert:ObjectConvert x:Key="ObjectConvert" />
  27. </ResourceDictionary>
  28. </UserControl.Resources>
  29. <StackPanel Name="ParentPanel" Orientation="Horizontal">
  30. <RepeatButton
  31. x:Name="BtnZoomOut"
  32. Width="32"
  33. Height="32"
  34. Margin="1,0,2,0"
  35. Background="Transparent"
  36. BorderThickness="0"
  37. Command="{Binding ZoomOutCommand}"
  38. Interval="200"
  39. Template="{StaticResource zoomout}" />
  40. <RepeatButton
  41. Name="BtnZoomIn"
  42. Width="32"
  43. Height="32"
  44. Margin="0,0,1,0"
  45. Background="Transparent"
  46. BorderThickness="0"
  47. Command="{Binding ZoomInCommand}"
  48. Interval="200"
  49. Template="{StaticResource zoomin}" />
  50. <Border
  51. Width="100"
  52. Height="32"
  53. BorderBrush="White"
  54. BorderThickness="0">
  55. <Grid>
  56. <Grid.ColumnDefinitions>
  57. <ColumnDefinition />
  58. <ColumnDefinition />
  59. </Grid.ColumnDefinitions>
  60. <Grid>
  61. <TextBox
  62. x:Name="TxtCurrentPageNum"
  63. Width="45"
  64. Height="32"
  65. Padding="0,5.5,0,0"
  66. Background="Transparent"
  67. BorderThickness="0"
  68. CaretBrush="Black"
  69. FontFamily="Segoe UI"
  70. FontSize="14"
  71. Foreground="Black"
  72. InputMethod.IsInputMethodEnabled="False"
  73. LostFocus="TxtCurrentPageNum_LostFocus"
  74. LostKeyboardFocus="TxtCurrentPageNum_LostKeyboardFocus"
  75. Text="{Binding CurrentPage}"
  76. TextAlignment="Center">
  77. <i:Interaction.Triggers>
  78. <i:EventTrigger EventName="KeyDown">
  79. <helper:AdvancedInvokeCommandAction
  80. Command="{Binding KeyDownCommand}"
  81. CommandParameter="{Binding ElementName=TxbCurrentPageNum}"
  82. PassEventArgsToCommand="True" />
  83. </i:EventTrigger>
  84. <i:EventTrigger EventName="PreviewKeyDown">
  85. <i:InvokeCommandAction Command="{Binding PreviewKeyDownCommand}" PassEventArgsToCommand="True" />
  86. </i:EventTrigger>
  87. <!--<i:EventTrigger EventName="LostKeyboardFocus">
  88. <helper:AdvancedInvokeCommandAction
  89. Command="{Binding LostKeyboardFocusCommand}"
  90. CommandParameter="{Binding ElementName=TxbCurrentPageNum}"
  91. PassEventArgsToCommand="True" />
  92. </i:EventTrigger>-->
  93. </i:Interaction.Triggers>
  94. </TextBox>
  95. <TextBlock
  96. Name="TxbCurrentPageNum"
  97. Width="45"
  98. Height="32"
  99. Padding="0,5.5,0,0"
  100. Background="Transparent"
  101. FontFamily="Segoe UI"
  102. FontSize="14"
  103. Foreground="White"
  104. PreviewMouseLeftButtonDown="TxbCurrentPageNum_PreviewMouseLeftButtonDown"
  105. Text="{Binding CurrentPage}"
  106. TextAlignment="Center"
  107. Visibility="Visible" />
  108. </Grid>
  109. <TextBlock
  110. x:Name="TxtPageCount"
  111. Grid.Column="1"
  112. Height="32"
  113. MinWidth="50"
  114. Padding="0,5.5,0,0"
  115. FontFamily="Segoe UI"
  116. FontSize="14"
  117. Foreground="#999999"
  118. Text="{Binding PageCount, StringFormat=/ {0}}"
  119. TextAlignment="Left" />
  120. </Grid>
  121. </Border>
  122. <Button
  123. Name="BtnPrePage"
  124. Margin="25,0,2,0"
  125. Background="Transparent"
  126. Command="{Binding PrePageCommand}"
  127. CommandParameter="{Binding ElementName=BtnPrePage}"
  128. Template="{StaticResource prepage}" />
  129. <Button
  130. x:Name="BtnNextPage"
  131. Margin="2,0,1,0"
  132. Background="Transparent"
  133. Command="{Binding NextPageCommand}"
  134. CommandParameter="{Binding ElementName=BtnNextPage}"
  135. Template="{StaticResource nextpage}" />
  136. </StackPanel>
  137. <i:Interaction.Triggers>
  138. <i:EventTrigger EventName="Loaded">
  139. <helper:AdvancedInvokeCommandAction Command="{Binding LoadedCommand}" PassEventArgsToCommand="True">
  140. <helper:AdvancedInvokeCommandAction.CommandParameter>
  141. <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
  142. <MultiBinding.Bindings>
  143. <Binding ElementName="BtnPrePage" />
  144. <Binding ElementName="BtnNextPage" />
  145. <Binding ElementName="BtnZoomOut" />
  146. <Binding ElementName="BtnZoomIn" />
  147. </MultiBinding.Bindings>
  148. </MultiBinding>
  149. </helper:AdvancedInvokeCommandAction.CommandParameter>
  150. </helper:AdvancedInvokeCommandAction>
  151. </i:EventTrigger>
  152. </i:Interaction.Triggers>
  153. </UserControl>