123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <UserControl
- x:Class="PDF_Office.Views.PropertyPanel.ViewModular.ReadModeContent"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:ViewModular="clr-namespace:PDF_Office.ViewModels.PropertyPanel.ViewModular"
- xmlns:convert="clr-namespace:PDF_Office.DataConvert"
- xmlns:converter="clr-namespace:PDF_Office.DataConvert"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:helper="clr-namespace:PDF_Office.Helper"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.ViewModular"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- x:Name="ReadMode"
- Width="auto"
- d:DataContext="{d:DesignInstance Type=ViewModular:ReadModeContentViewModel}"
- d:DesignHeight="44"
- d:DesignWidth="230"
- Background="#CC000000"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <convert:ObjectConvert x:Key="ObjectConvert" />
- </ResourceDictionary>
- </UserControl.Resources>
- <StackPanel Name="ParentPanel" Orientation="Horizontal">
- <RepeatButton
- x:Name="BtnZoomOut"
- Width="32"
- Height="32"
- Margin="1,0,2,0"
- Background="Transparent"
- BorderThickness="0"
- Command="{Binding ZoomOutCommand}"
- Interval="200"
- Template="{StaticResource zoomout}" />
- <RepeatButton
- Name="BtnZoomIn"
- Width="32"
- Height="32"
- Margin="0,0,1,0"
- Background="Transparent"
- BorderThickness="0"
- Command="{Binding ZoomInCommand}"
- Interval="200"
- Template="{StaticResource zoomin}" />
- <Border
- Width="100"
- Height="32"
- BorderBrush="White"
- BorderThickness="0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Grid>
- <TextBox
- x:Name="TxtCurrentPageNum"
- Width="45"
- Height="32"
- Padding="0,5.5,0,0"
- Background="Transparent"
- BorderThickness="0"
- CaretBrush="Black"
- FontFamily="Segoe UI"
- FontSize="14"
- Foreground="Black"
- InputMethod.IsInputMethodEnabled="False"
- LostFocus="TxtCurrentPageNum_LostFocus"
- LostKeyboardFocus="TxtCurrentPageNum_LostKeyboardFocus"
- Text="{Binding CurrentPage}"
- TextAlignment="Center">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="KeyDown">
- <helper:AdvancedInvokeCommandAction
- Command="{Binding KeyDownCommand}"
- CommandParameter="{Binding ElementName=TxbCurrentPageNum}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- <i:EventTrigger EventName="PreviewKeyDown">
- <i:InvokeCommandAction Command="{Binding PreviewKeyDownCommand}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- <!--<i:EventTrigger EventName="LostKeyboardFocus">
- <helper:AdvancedInvokeCommandAction
- Command="{Binding LostKeyboardFocusCommand}"
- CommandParameter="{Binding ElementName=TxbCurrentPageNum}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>-->
- </i:Interaction.Triggers>
- </TextBox>
- <TextBlock
- Name="TxbCurrentPageNum"
- Width="45"
- Height="32"
- Padding="0,5.5,0,0"
- Background="Transparent"
- FontFamily="Segoe UI"
- FontSize="14"
- Foreground="White"
- PreviewMouseLeftButtonDown="TxbCurrentPageNum_PreviewMouseLeftButtonDown"
- Text="{Binding CurrentPage}"
- TextAlignment="Center"
- Visibility="Visible" />
- </Grid>
- <TextBlock
- x:Name="TxtPageCount"
- Grid.Column="1"
- Height="32"
- MinWidth="50"
- Padding="0,5.5,0,0"
- FontFamily="Segoe UI"
- FontSize="14"
- Foreground="#999999"
- Text="{Binding PageCount, StringFormat=/ {0}}"
- TextAlignment="Left" />
- </Grid>
- </Border>
- <Button
- Name="BtnPrePage"
- Margin="25,0,2,0"
- Background="Transparent"
- Command="{Binding PrePageCommand}"
- CommandParameter="{Binding ElementName=BtnPrePage}"
- Template="{StaticResource prepage}" />
- <Button
- x:Name="BtnNextPage"
- Margin="2,0,1,0"
- Background="Transparent"
- Command="{Binding NextPageCommand}"
- CommandParameter="{Binding ElementName=BtnNextPage}"
- Template="{StaticResource nextpage}" />
- </StackPanel>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Loaded">
- <helper:AdvancedInvokeCommandAction Command="{Binding LoadedCommand}" PassEventArgsToCommand="True">
- <helper:AdvancedInvokeCommandAction.CommandParameter>
- <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
- <MultiBinding.Bindings>
- <Binding ElementName="BtnPrePage" />
- <Binding ElementName="BtnNextPage" />
- <Binding ElementName="BtnZoomOut" />
- <Binding ElementName="BtnZoomIn" />
- </MultiBinding.Bindings>
- </MultiBinding>
- </helper:AdvancedInvokeCommandAction.CommandParameter>
- </helper:AdvancedInvokeCommandAction>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </UserControl>
|