<UserControl x:Class="PDF_Master.Views.BottomToolContent" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cus="clr-namespace:PDF_Master.CustomControl" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:local="clr-namespace:PDF_Master.Views" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:prism="http://prismlibrary.com/" xmlns:sys="clr-namespace:System;assembly=System" xmlns:viewmodels="clr-namespace:PDF_Master.ViewModels" d:DataContext="{d:DesignInstance Type=viewmodels:BottomToolContentViewModel}" d:DesignHeight="32" d:DesignWidth="1280" prism:ViewModelLocator.AutoWireViewModel="True" Background="{StaticResource color.sys.layout.mg}" BorderBrush="{StaticResource color.sys.layout.divider}" BorderThickness="0,1,0,0" mc:Ignorable="d"> <UserControl.Resources> <RoutedUICommand x:Key="SetSinglePage" Text="SetSinglePage" /> <RoutedUICommand x:Key="SetDoublePage" Text="SetDoublePage" /> </UserControl.Resources> <UserControl.InputBindings> <KeyBinding Key="Up" Command="{Binding FirstPageCommand}" Modifiers="Ctrl" /> <KeyBinding Key="Down" Command="{Binding LastPageCommand}" Modifiers="Ctrl" /> <KeyBinding Key="Left" Command="{Binding PrePageCommand}" Modifiers="Ctrl" /> <KeyBinding Key="Right" Command="{Binding NextPageCommand}" Modifiers="Ctrl" /> <KeyBinding Key="OemOpenBrackets" Command="{Binding PreViewCommand}" Modifiers="Ctrl" /> <KeyBinding Key="OemCloseBrackets" Command="{Binding PreViewCommand}" Modifiers="Ctrl" /> <KeyBinding Key="G" Command="{Binding PageTextKeyDownCommand}" Modifiers="Ctrl+Alt" /> <KeyBinding Key="OemPlus" Command="{Binding ZoomInCommand}" Modifiers="Ctrl" /> <KeyBinding Key="OemPlus" Command="{Binding ZoomInCommand}" Modifiers="Ctrl+Shift" /> <KeyBinding Key="OemMinus" Command="{Binding ZoomOutCommand}" Modifiers="Ctrl" /> <KeyBinding Command="{StaticResource SetSinglePage}" Gesture="Ctrl+1" /> <KeyBinding Command="{StaticResource SetDoublePage}" Gesture="Ctrl+2" /> </UserControl.InputBindings> <UserControl.CommandBindings> <CommandBinding x:Name="SetSinglePageCommand" Command="{StaticResource SetSinglePage}" Executed="SetSinglePageCommand_Executed" /> <CommandBinding x:Name="SetDoublePageCommand" Command="{StaticResource SetDoublePage}" Executed="SetDoublePageCommand_Executed" /> </UserControl.CommandBindings> <Grid Height="32" Background="{StaticResource color.sys.layout.mg}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="auto" MinWidth="{Binding ElementName=StkPnlCenter, Path=ActualWidth}" /> <ColumnDefinition MinWidth="{Binding ElementName=StkPnlRight, Path=ActualWidth}" /> </Grid.ColumnDefinitions> <StackPanel Name="StkPnlCenter" Grid.Column="1" HorizontalAlignment="Center" Orientation="Horizontal"> <Button Width="24" Height="24" Margin="4" Command="{Binding FirstPageCommand}" Style="{StaticResource btn.selector}"> <Path Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M16.4056 7.40441L11.8105 11.9995L16.4056 16.5945L15.3449 17.6552L10.2196 12.5298C9.92666 12.2369 9.92666 11.762 10.2196 11.4691L15.3449 6.34375L16.4056 7.40441ZM7.25 6.5V17.5H8.75V6.5H7.25Z" Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" /> </Button> <Button Width="24" Height="24" Margin="4" Command="{Binding PrePageCommand}" Style="{StaticResource btn.selector}"> <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="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" /> </Button> <cus:TextBoxEx Width="57" Height="24" InputMethod.IsInputMethodEnabled="False" ShowClose="False" Text="{Binding CurrentPage}"> <i:Interaction.Triggers> <i:EventTrigger EventName="KeyDown"> <i:InvokeCommandAction Command="{Binding PageTextKeyDownCommand}" PassEventArgsToCommand="True" /> </i:EventTrigger> <i:EventTrigger EventName="PreviewKeyDown"> <i:InvokeCommandAction Command="{Binding PageTextPreviewKeyDownCommand}" PassEventArgsToCommand="True" /> </i:EventTrigger> </i:Interaction.Triggers> </cus:TextBoxEx> <TextBlock Margin="8,0" VerticalAlignment="Center" Foreground="{StaticResource color.sys.text.neutral.lv1}" Text="/" /> <TextBlock MinWidth="13" VerticalAlignment="Center" Foreground="{StaticResource color.sys.text.neutral.lv1}" Text="{Binding PageCount, StringFormat={}{0}}" /> <Button Width="24" Height="24" Margin="4" Command="{Binding NextPageCommand}" Style="{StaticResource btn.selector}"> <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="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" /> </Button> <Button Width="24" Height="24" Margin="4" Command="{Binding LastPageCommand}" Style="{StaticResource btn.selector}"> <Path Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M7.24968 7.40441L11.8447 11.9995L7.24968 16.5945L8.31034 17.6552L13.4357 12.5298C13.7286 12.2369 13.7286 11.762 13.4357 11.4691L8.31034 6.34375L7.24968 7.40441ZM16.4053 6.5V17.5H14.9053V6.5H16.4053Z" Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" /> </Button> <Separator Margin="4,0,0,0" Style="{StaticResource VerticalSeparatorStyle}" /> <Button Width="24" Height="24" Margin="8,0" Command="{Binding PreViewCommand}" IsEnabled="{Binding IsPreEnable}" Style="{StaticResource btn.selector}"> <Path Width="16" Height="16" Data="M2.56067 7.28028L5.7803 4.06066L4.71964 3L0.21967 7.49997C-0.0732233 7.79286 -0.0732233 8.26774 0.21967 8.56063L4.71964 13.0606L5.7803 11.9999L2.56065 8.78028L15.75 8.78029V7.28029L2.56067 7.28028Z" Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" /> </Button> <Button Width="24" Height="24" Command="{Binding NextViewCommnad}" IsEnabled="{Binding IsNextEnable}" Style="{StaticResource btn.selector}"> <Path Width="16" Height="16" Data="M13.1893 8.78026L9.9697 11.9999L11.0304 13.0605L15.5303 8.56058C15.8232 8.26768 15.8232 7.79281 15.5303 7.49992L11.0304 2.99995L9.9697 4.06061L13.1894 7.28026L0 7.28026V8.78026L13.1893 8.78026Z" Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" /> </Button> </StackPanel> <StackPanel x:Name="StkPnlRight" Grid.Column="2" HorizontalAlignment="Right" IsEnabled="{Binding RightPanelEnable}" Orientation="Horizontal"> <ToggleButton Width="24" Height="24" Margin="4" Command="{Binding SetViewModeCommand}" IsChecked="{Binding IsContinue}" Style="{StaticResource SubToolbarTgb}"> <ToggleButton.ToolTip> <StackPanel> <TextBlock FontWeight="Bold" Text="{Binding T_ContinuousText}" /> <TextBlock Text="{Binding T_ContinuousTip}" /> </StackPanel> </ToggleButton.ToolTip> <Grid> <Path Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M7.5 4V8C7.5 8.13807 7.61193 8.25 7.75 8.25H16.25C16.3881 8.25 16.5 8.13807 16.5 8V4H18V8C18 8.9665 17.2165 9.75 16.25 9.75H7.75C6.7835 9.75 6 8.9665 6 8V4H7.5ZM6 13C6 12.0335 6.7835 11.25 7.75 11.25H12.8358C13.2999 11.25 13.745 11.4344 14.0732 11.7626L17.4874 15.1768C17.8156 15.505 18 15.9501 18 16.4142V20H16.5V16.75H13.25C12.8358 16.75 12.5 16.4142 12.5 16V12.75H7.75C7.61193 12.75 7.5 12.8619 7.5 13V20H6V13ZM14 13.8107V15.25H15.4393L14 13.8107Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ToggleButton}, Path=Foreground}" /> </Grid> </ToggleButton> <Separator Width="1" Height="10" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" /> <RadioButton Name="SinglePage_Btn" Width="24" Height="24" Margin="4" Command="{Binding SetViewModeCommand}" IsChecked="{Binding IsSingleView}" Style="{StaticResource StateBarRbt}"> <RadioButton.ToolTip> <StackPanel> <TextBlock FontWeight="Bold" Text="{Binding T_SinglePageText}" /> <TextBlock Text="{Binding T_SinglePageTip}" /> </StackPanel> </RadioButton.ToolTip> <Path Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M7.5 5.75C7.5 5.61193 7.61193 5.5 7.75 5.5H12.5V8.75C12.5 9.16421 12.8358 9.5 13.25 9.5H16.5V18.25C16.5 18.3881 16.3881 18.5 16.25 18.5H7.75C7.61193 18.5 7.5 18.3881 7.5 18.25V5.75ZM15.4393 8L14 6.56066V8H15.4393ZM7.75 4C6.7835 4 6 4.7835 6 5.75V18.25C6 19.2165 6.7835 20 7.75 20H16.25C17.2165 20 18 19.2165 18 18.25V9.16421C18 8.70008 17.8156 8.25497 17.4874 7.92678L14.0732 4.51256C13.745 4.18437 13.2999 4 12.8358 4H7.75Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Foreground}" /> </RadioButton> <RadioButton Name="DoublePage_Btn" Width="24" Height="24" Margin="4" Command="{Binding SetViewModeCommand}" Cursor="Hand" IsChecked="{Binding IsDoubleView}" Style="{StaticResource StateBarRbt}"> <RadioButton.ToolTip> <StackPanel> <TextBlock FontWeight="Bold" Text="{Binding T_FacingText}" /> <TextBlock Text="{Binding T_FacingTip}" /> </StackPanel> </RadioButton.ToolTip> <Path Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M12.75 17.5V6H14.5V9.25C14.5 9.66421 14.8358 10 15.25 10H18.5V17.25C18.5 17.3881 18.3881 17.5 18.25 17.5H12.75ZM17.4393 8.5L16 7.06066V8.5H17.4393ZM18.25 19H12H5.75C4.7835 19 4 18.2165 4 17.25V9.25V6.25C4 5.2835 4.7835 4.5 5.75 4.5H8.75H12H14.8358C15.2999 4.5 15.745 4.68437 16.0732 5.01256L19.7803 8.71967C19.921 8.86032 20 9.05109 20 9.25V17.25C20 18.2165 19.2165 19 18.25 19ZM11.25 6V17.5H5.75C5.61193 17.5 5.5 17.3881 5.5 17.25V9.25V6.25C5.5 6.11193 5.61193 6 5.75 6H8.75H11.25Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Foreground}" /> </RadioButton> <RadioButton Width="24" Height="24" Margin="4" Command="{Binding SetViewModeCommand}" IsChecked="{Binding IsBookMode}" Style="{StaticResource StateBarRbt}"> <RadioButton.ToolTip> <StackPanel> <TextBlock FontWeight="Bold" Text="{Binding T_BookModeText}" /> <TextBlock Text="{Binding T_BookModeTip}" /> </StackPanel> </RadioButton.ToolTip> <Path Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M6.51514 11V5.5H8.58932L10.116 7.19217V11H6.51514ZM6.16514 4C5.53001 4 5.01514 4.51487 5.01514 5.15V11.35C5.01514 11.9851 5.53001 12.5 6.16514 12.5H10.466C11.1011 12.5 11.616 11.9851 11.616 11.35V7.05762C11.616 6.77304 11.5105 6.49857 11.3198 6.28728L9.5988 4.37966C9.38074 4.13796 9.07047 4 8.74494 4H6.16514ZM5.01514 14.4C5.01514 13.7649 5.53001 13.25 6.16514 13.25H8.9228H10.466C11.1011 13.25 11.616 13.7649 11.616 14.4V16.1538V20H10.116V16.1538V14.75H8.9228H6.51514V20H5.01514V14.4ZM12.4114 14.4C12.4114 13.7649 12.9262 13.25 13.5614 13.25H16.319H17.8622C18.4973 13.25 19.0122 13.7649 19.0122 14.4V16.1538V20H17.5122V16.1538V14.75H16.319H13.9114V20H12.4114V14.4Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Foreground}" /> </RadioButton> <Separator Width="1" Height="10" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" /> <ToggleButton Name="TbtnIsViewPanelOpen" Width="24" Height="24" Margin="4" Command="{Binding ShowViewModularCommand}" CommandParameter="{Binding ElementName=TbtnIsViewPanelOpen, Path=IsChecked}" IsChecked="{Binding IsShowViewModular}" Style="{StaticResource SubToolbarTgb}"> <ToggleButton.ToolTip> <StackPanel> <TextBlock FontWeight="Bold" Text="{Binding T_ShowViewModularText}" /> <!--<TextBlock Text="{Binding T_ShowViewModularTip}"/>--> </StackPanel> </ToggleButton.ToolTip> <Path Data="M1.5 13V3H7.25V13H1.5ZM8.75 13H14.5V3H8.75V13ZM0 2.5C0 1.94772 0.447715 1.5 1 1.5H15C15.5523 1.5 16 1.94772 16 2.5V13.5C16 14.0523 15.5523 14.5 15 14.5H1C0.447715 14.5 0 14.0523 0 13.5V2.5ZM3 6.25H6V7.75H3V6.25ZM6 9.25H3V10.75H6V9.25Z" Fill="{StaticResource color.icon.base.neutral.norm.lv1}" /> </ToggleButton> <Border Margin="12,0,16,0" HorizontalAlignment="Center" VerticalAlignment="Center" Background="{StaticResource color.field.bg.def}" BorderBrush="{StaticResource color.field.border.norm}" BorderThickness="1" CornerRadius="4"> <StackPanel Height="20" FocusVisualStyle="{x:Null}" Orientation="Horizontal"> <Grid> <ComboBox Width="72" Background="White" BorderThickness="0" FocusVisualStyle="{x:Null}" MaxDropDownHeight="510" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged"> <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True" /> </i:EventTrigger> </i:Interaction.Triggers> <ComboBoxItem x:Name="ActualSize" Style="{StaticResource ZoomComboxItemStyle}"> <StackPanel Orientation="Horizontal"> <Border x:Name="ActualSizeBorder" Margin="10,0,12,0" /> <TextBlock x:Name="ActualSizeText" VerticalAlignment="Center" Text="Actual Size" /> </StackPanel> </ComboBoxItem> <ComboBoxItem x:Name="FitWidth" Style="{StaticResource ZoomComboxItemStyle}"> <StackPanel Orientation="Horizontal "> <Border Name="FitWidthBorder" Margin="10,0,12,0"> <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/fitwidth.png" />--> </Border> <TextBlock x:Name="FitWidthText" Text="Fit Width" /> </StackPanel> </ComboBoxItem> <ComboBoxItem x:Name="FitHeight" Style="{StaticResource ZoomComboxItemStyle}"> <StackPanel Orientation="Horizontal"> <Border Name="FitHeightBorder" Margin="10,0,12,0"> <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/adaptationHeight.png" />--> </Border> <TextBlock x:Name="FitHeightText" Text="Fit Height" /> </StackPanel> </ComboBoxItem> <Separator Height="1" BorderBrush="#33000000" BorderThickness="1" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" /> <ComboBoxItem Padding="40,0,0,0" Content="10%" Style="{StaticResource ZoomComboxItemStyle}" Tag="10" /> <ComboBoxItem Padding="40,0,0,0" Content="25%" Style="{StaticResource ZoomComboxItemStyle}" Tag="25" /> <ComboBoxItem Padding="40,0,0,0" Content="50%" Style="{StaticResource ZoomComboxItemStyle}" Tag="50" /> <ComboBoxItem Padding="40,0,0,0" Content="75%" Style="{StaticResource ZoomComboxItemStyle}" Tag="75" /> <ComboBoxItem Padding="40,0,0,0" Content="100%" Style="{StaticResource ZoomComboxItemStyle}" Tag="100" /> <ComboBoxItem Padding="40,0,0,0" Content="150%" Style="{StaticResource ZoomComboxItemStyle}" Tag="150" /> <ComboBoxItem Padding="40,0,0,0" Content="200%" Style="{StaticResource ZoomComboxItemStyle}" Tag="200" /> <ComboBoxItem Padding="40,0,0,0" Content="400%" Style="{StaticResource ZoomComboxItemStyle}" Tag="400" /> <ComboBoxItem Padding="40,0,0,0" Content="800%" Style="{StaticResource ZoomComboxItemStyle}" Tag="800" /> </ComboBox> <cus:TextBoxEx Width="46" Height="14" Margin="4,0,0,0" Padding="1,0,0,0" HorizontalAlignment="Left" Background="White" BorderThickness="0" CornerRadius="0" InputMethod.IsInputMethodEnabled="False" PreviewTextInput="TextBoxEx_PreviewTextInput" ShowClose="False" Style="{StaticResource InnerTextBox}" Text="{Binding CurrentZoom, Mode=OneWay, StringFormat={}{0}%}" /> <i:Interaction.Triggers> <i:EventTrigger EventName="PreviewKeyDown"> <i:InvokeCommandAction Command="{Binding PreviewKeyDown}" PassEventArgsToCommand="True" /> </i:EventTrigger> </i:Interaction.Triggers> </Grid> <Separator Margin="0" Style="{StaticResource VerticalSeparatorStyle}" /> <StackPanel Orientation="Horizontal"> <Button Width="20" Height="20" Margin="4,0" VerticalContentAlignment="Center" Command="{Binding ZoomOutCommand}" Style="{StaticResource subToolBar}"> <Path Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M4 9L16 9L16 11L4 11L4 9Z" Fill="{StaticResource color.icon.base.neutral.norm.lv1}" /> </Button> <Button Width="20" Height="20" Margin="4,0" VerticalContentAlignment="Center" Command="{Binding ZoomInCommand}" Style="{StaticResource subToolBar}"> <Path Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M9 11V16H11V11H16V9H11V4H9V9H4L4 11H9Z" Fill="{StaticResource color.icon.base.neutral.norm.lv1}" /> </Button> </StackPanel> </StackPanel> </Border> </StackPanel> </Grid> </UserControl>