123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- <Window x:Class="ComPDFKit.Controls.Compress.CompressDialog"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:ComPDFKit.Controls.Compress"
- mc:Ignorable="d"
- Title="CompressWPFDialog" Height="450" Width="890" ResizeMode="NoResize"
- ShowInTaskbar="False"
- WindowStartupLocation="CenterOwner"
- WindowStyle="SingleBorderWindow">
- <Window.Resources>
- <ResourceDictionary>
- <local:MaxWidthToTextTrimmingConverter x:Key="MaxWidthToTextTrimmingConverter" />
- <Style x:Key="LeftAlignedHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- </Style>
-
- <Style x:Key="DisabledButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Padding" Value="5" />
- <Setter Property="Width" Value="100" />
- <Setter Property="Height" Value="40" />
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Foreground" Value="Gray" />
- </Trigger>
- </Style.Triggers>
- </Style>
-
- <Style x:Key="ResizableGridViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="GridViewColumnHeader">
- <Grid x:Name="Root" Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <ContentPresenter Grid.Column="0" VerticalAlignment="Center" />
- <Thumb
- x:Name="PART_HeaderGripper"
- Grid.Column="1"
- Width="5"
- HorizontalAlignment="Right"
- Cursor="SizeWE"
- DragDelta="PART_HeaderGripper_DragDelta" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="RoundButtonStyle" TargetType="{x:Type Button}">
- <Setter Property="Background" Value="White" />
- <Setter Property="BorderBrush" Value="Black" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Padding" Value="5" />
- <Setter Property="Margin" Value="12,8" />
- <Setter Property="Width" Value="100" />
- <Setter Property="Height" Value="40" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border
- x:Name="border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="0">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="border" Property="Background" Value="White" />
- <Setter TargetName="border" Property="BorderBrush" Value="LightGray" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="border" Property="Opacity" Value="0.5" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="HeadStyle" TargetType="{x:Type GridViewColumnHeader}">
- <Setter Property="OverridesDefaultStyle" Value="False" />
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="FontSize" Value="14" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
- <Grid Name="g" Background="Transparent">
- <Border Name="bd" Padding="{TemplateBinding Padding}">
- <Grid>
- <!-- Gripper 控件 -->
- <Thumb
- x:Name="PART_HeaderGripper"
- Width="5"
- HorizontalAlignment="Right"
- Background="White"
- BorderBrush="LightGray"
- Cursor="SizeWE"
- Visibility="Collapsed" />
- <ContentPresenter Margin="5,3,0,3" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
- </Grid>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="g" Property="Background" Value="LightGray" />
- <Setter TargetName="g" Property="Opacity" Value="0.7" />
- <Setter TargetName="PART_HeaderGripper" Property="Visibility" Value="Visible" />
- <Setter TargetName="PART_HeaderGripper" Property="Background" Value="LightGray" />
- <Setter TargetName="PART_HeaderGripper" Property="Opacity" Value="0.5" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="ListViewItemStyle" TargetType="{x:Type ListViewItem}">
- <Style.Setters>
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="Foreground" Value="Black" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListViewItem}">
- <Border
- x:Name="bd"
- Padding="{TemplateBinding Padding}"
- BorderBrush="LightGray"
- Background="Transparent"
- BorderThickness="1"
- SnapsToDevicePixels="True">
- <GridViewRowPresenter
- Margin="0,2"
- Columns="{TemplateBinding GridView.ColumnCollection}"
- Content="{TemplateBinding Content}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Trigger.Setters>
- <Setter TargetName="bd" Property="Background" Value="LightGray" />
- <Setter TargetName="bd" Property="Opacity" Value="0.8" />
- </Trigger.Setters>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Trigger.Setters>
- <Setter TargetName="bd" Property="Background" Value="LightGray" />
- <Setter TargetName="bd" Property="Opacity" Value="0.7" />
- <Setter TargetName="bd" Property="BorderBrush" Value="LightGray" />
- </Trigger.Setters>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style.Setters>
- </Style>
- <Style x:Key="BigCustomRadioButtonStyle" TargetType="{x:Type RadioButton}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RadioButton}">
- <Grid>
- <Border x:Name="border">
- <Grid Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Border x:Name="radioButtonBorder" Grid.Column="0" BorderBrush="Black" Width="18" Height="18" Margin="0" BorderThickness="1.4" CornerRadius="20" SnapsToDevicePixels="True">
- <Path x:Name="checkMark" Fill="Black" StrokeThickness="2" Visibility="Collapsed" Data="M0 5C0 2.23858 2.23858 0 5 0C7.76142 0 10 2.23858 10 5C10 7.76142 7.76142 10 5 10C2.23858 10 0 7.76142 0 5Z" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- <ContentPresenter Grid.Column="1" Margin="5,0,0,0" VerticalAlignment="Center" RecognizesAccessKey="True"/>
- </Grid>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="checkMark" Property="Visibility" Value="Visible"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="radioButtonBorder" Property="Background" Value="#E1E1E1"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="radioButtonBorder" Property="Background" Value="#E1E1E1"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="radioButtonBorder" Property="Opacity" Value="0.3"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
- </Window.Resources>
- <Grid>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- <RowDefinition Height="50" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="640" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <DockPanel LastChildFill="True">
- <Button
- Margin="12,0,0,0"
- Name="btnAddFile"
- MinWidth="112"
- Padding="8,0,8,0"
- Height="32"
- Click="btnAddFile_Click"
- Content=" Add File"
- DockPanel.Dock="Left"
- BorderBrush="#33000000" Background="#E1E1E1" BorderThickness="1" Style="{StaticResource DisabledButtonStyle}" />
- <StackPanel Name="flowLayoutPanel2" DockPanel.Dock="Right">
- <Label
- Name="lbTotalFiles"
- Width="120"
- Height="32"
- Margin="0,5"
- HorizontalAlignment="Right"
- VerticalContentAlignment="Center"
- Content="Total 10 Files" />
- </StackPanel>
- </DockPanel>
- <StackPanel Name="panel1" Grid.Row="1" >
- <ListView
- VerticalContentAlignment="Top"
- HorizontalAlignment="Left"
- Margin="12,0,0,0"
- Name="CompressListView"
- Width="620"
- Height="250"
- AllowDrop="True"
- DragOver="ConverterListView_DragOver"
- Drop="ConverterListView_Drop"
- ItemContainerStyle="{StaticResource ListViewItemStyle}"
- Loaded="ConverterListView_Loaded"
- PreviewMouseLeftButtonDown="ConverterListView_PreviewMouseLeftButtonDown"
- SizeChanged="ConverterListView_SizeChanged"
- MouseMove="ConverterListView_MouseMove"
- PreviewMouseUp="ConverterListView_PreviewMouseUp"
- SelectionChanged="ConverterListView_SelectionChanged">
- <ListView.View>
- <GridView AllowsColumnReorder="False" ColumnHeaderContainerStyle="{StaticResource HeadStyle}">
- <GridViewColumn
- x:Name="FileName"
- Width="180"
- Header="Name">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
- <Image
- Width="20"
- Height="20"
- Margin="5"
- Source="../../Resources/Image/PDFicon.png"/>
- <TextBlock
- x:Name="TxbName"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- SizeChanged="TxbName_SizeChanged"
- Text="{Binding Name}"
- TextAlignment="Left" TextTrimming="CharacterEllipsis">
- <TextBlock.ToolTip>
- <ToolTip>
- <TextBlock Text="{Binding Name}" />
- </ToolTip>
- </TextBlock.ToolTip>
- </TextBlock>
- </StackPanel>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn
- x:Name="SizeHeader"
- Width="80"
- Header="Size">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Size}" TextTrimming="CharacterEllipsis">
- <TextBlock.ToolTip>
- <ToolTip>
- <TextBlock Text="{Binding Size}" />
- </ToolTip>
- </TextBlock.ToolTip>
-
- </TextBlock>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn
- x:Name="PathHeader"
- Width="250"
- Header="Path">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <TextBlock
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Text="{Binding Path}"
- TextAlignment="Left" TextTrimming="CharacterEllipsis">
- <TextBlock.ToolTip>
- <ToolTip>
- <TextBlock Text="{Binding Path}" />
- </ToolTip>
- </TextBlock.ToolTip>
- </TextBlock>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn
- x:Name="ProgressHeader"
- Width="50"
- Header="Progress">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Progress}" />
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- </GridView>
- </ListView.View>
- </ListView>
- <WrapPanel Margin="0,12,0,0">
- <Button
- Margin="12,0,0,0"
- Name="btnRemove"
- MinWidth="112"
- Padding="8,0,8,0"
- Height="32"
- Click="btnRemove_Click"
- Content="Delete"
- BorderBrush="#33000000" Background="#E1E1E1" BorderThickness="1" Style="{StaticResource DisabledButtonStyle}"
- />
- <Button
- Name="btnMoveUp"
- Width="150"
- Height="32"
- Margin="10,5"
- Content="MoveUp"
- IsEnabled="False" Style="{StaticResource DisabledButtonStyle}"
- BorderBrush="#33000000" Background="#E1E1E1" BorderThickness="1" Click="btnMoveUp_Click" Visibility="Collapsed"/>
- <Button
- Name="btnMoveDown"
- Width="150"
- Height="32"
- Margin="10,5"
- Content="Move Down"
- IsEnabled="False"
- BorderBrush="#33000000" Background="#E1E1E1" BorderThickness="1" Click="btnMoveDown_Click" Style="{StaticResource DisabledButtonStyle}" Visibility="Collapsed"/>
- </WrapPanel>
- </StackPanel>
- <GroupBox
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.Column="1"
- Margin="8,40,20,0"
- Name="groupBox1"
- Width="200"
- Height="262"
- VerticalAlignment="Top">
- <GroupBox.Header>
- <TextBlock Name="groupBox1Text" Text="Optimization Quality" FontWeight="DemiBold"></TextBlock>
- </GroupBox.Header>
- <StackPanel>
- <RadioButton
- Name="rbtnLow"
- Margin="8,8,0,0"
- Checked="rbtnAllPage_Checked"
- Content="Low"
- GroupName="GroupPageRange" Style="{StaticResource BigCustomRadioButtonStyle}"/>
- <RadioButton
- Name="rbtnMedium"
- Margin="8,8"
- Checked="rbtnCurrentPage_Checked"
- Content="Medium"
- GroupName="GroupPageRange" Style="{StaticResource BigCustomRadioButtonStyle}"/>
- <RadioButton
- Name="rbtnHigh"
- Margin="8,0"
- Checked="rbtnOldPageOnly_Checked"
- Content="High"
- GroupName="GroupPageRange" Style="{StaticResource BigCustomRadioButtonStyle}"/>
- <StackPanel Orientation="Horizontal">
- <RadioButton
- Name="rbtnCustom"
- Margin="8,8"
- Checked="RbtnEvenPageOnly_Checked"
- Content="Custom"
- GroupName="GroupPageRange" Style="{StaticResource BigCustomRadioButtonStyle}"/>
- <StackPanel Orientation="Horizontal" IsEnabled="{Binding ElementName=rbtnCustom,Path=IsChecked}">
- <TextBox Name="txtQuality" Width="50" Height="28" PreviewTextInput="TextBox_PreviewTextInput" TextChanged="TextBox_TextChanged" InputMethod.IsInputMethodEnabled="False" Padding="0,5,0,0" Text="100"></TextBox>
- <TextBlock Height="15" Margin="8,0,0,0">%</TextBlock>
- </StackPanel>
- </StackPanel>
- </StackPanel>
- </GroupBox>
- <WrapPanel
- Width="300"
- HorizontalAlignment="Right"
- DockPanel.Dock="Right" Grid.Row="2" Grid.ColumnSpan="2">
- <Button
- Name="btnCompress"
- Style="{StaticResource DisabledButtonStyle}"
- BorderBrush="#FA477EDE" Background="#E1E1E1" BorderThickness="1"
- MinWidth="112"
- Padding="8,0,8,0"
- Height="32"
- Margin="30,0,2,0"
- HorizontalAlignment="Right"
- VerticalContentAlignment="Center"
- IsEnabled="False"
- Click="btnCompress_Click">
- Compress
- </Button>
- <Button
- Name="btnCancel"
- MinWidth="112"
- Padding="8,0,8,0"
- Height="32"
- Margin="10,0,10,0"
- HorizontalAlignment="Right"
- VerticalContentAlignment="Center"
- Click="btnCancel_Click" Style="{StaticResource DisabledButtonStyle}"
- BorderBrush="#33000000" Background="#E1E1E1" BorderThickness="1">
- Cancel
- </Button>
- </WrapPanel>
- </Grid>
- </Grid>
- </Window>
|