123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <UserControl
- x:Class="PDF_Master.Views.Dialog.PageEditDialogs.InsertDialog"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:convert="clr-namespace:PDF_Master.DataConvert"
- 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.Dialog.PageEditDialogs"
- xmlns:mainpage="clr-namespace:PDF_Master.Strings.MainPage"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:model="clr-namespace:PDF_Master.Model.PageEdit"
- xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
- xmlns:prism="http://prismlibrary.com/"
- Width="530"
- Height="358"
- d:DataContext="{d:DesignInstance Type=pageeditdialogs:InsertDialogViewModel}"
- d:DesignHeight="358"
- d:DesignWidth="530"
- prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <Style x:Key="TextBoxStyle" TargetType="TextBox">
- <Setter Property="Height" Value="32" />
- <Setter Property="FontSize" Value="14" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="TextBox">
- <Border
- x:Name="border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="5"
- SnapsToDevicePixels="True">
- <!--<TextBox
- Name="markText"
- VerticalAlignment="Center"
- Background="Transparent"
- BorderBrush="Transparent"
- FontSize="12"
- Text="{TemplateBinding Text}"
- Visibility="Visible" />-->
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="border" Property="Opacity" Value="0.56" />
- <Setter TargetName="border" Property="Background" Value="{StaticResource color.field.bg.dis}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
- </Trigger>
- <Trigger Property="IsKeyboardFocused" Value="true">
- <Setter TargetName="border" Property="BorderBrush" Value="#FF569DE5" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <convert:FileToImageSourceConvert x:Key="FileToImageSourceConvert" />
- <DataTemplate x:Key="CustomItem" DataType="{x:Type model:CustomPageItem}">
- <StackPanel HorizontalAlignment="Center">
- <Border
- Name="BdBorder"
- Width="104"
- Height="64"
- BorderBrush="#A0A2AE"
- BorderThickness="1"
- CornerRadius="6">
- <Border.Background>
- <ImageBrush ImageSource="{Binding FilePath, Converter={StaticResource FileToImageSourceConvert}}" />
- </Border.Background>
- </Border>
- <Label
- Name="LbPageNum"
- Width="auto"
- Margin="0,4,0,0"
- HorizontalAlignment="Center"
- Background="Transparent"
- Content="{Binding Name}"
- FontSize="12" />
- </StackPanel>
- <DataTemplate.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
- <Setter TargetName="BdBorder" Property="BorderBrush" Value="#118AFF" />
- <Setter TargetName="BdBorder" Property="CornerRadius" Value="4" />
- <Setter TargetName="LbPageNum" Property="Foreground" Value="#118AFF" />
- </DataTrigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ResourceDictionary>
- </UserControl.Resources>
- <cus:DialogContent Header="{x:Static mainpage:MainPage.PageEdit_InsertaCustomPage}">
- <cus:DialogContent.Content>
- <Grid>
- <Grid.RowDefinitions>
- <!--<RowDefinition />-->
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <!-- 20230704 如果设置为Hidden,可能会导致弹窗无法打开,报 图片被占用 -->
- <ListBox
- Padding="0,16,0,0"
- HorizontalAlignment="Center"
- BorderThickness="0"
- ItemTemplate="{StaticResource CustomItem}"
- ItemsSource="{Binding Pages}"
- SelectedIndex="{Binding ItemSelectedIndex, Mode=TwoWay}"
- Visibility="Collapsed">
- <ListBox.ItemContainerStyle>
- <Style TargetType="{x:Type ListBoxItem}">
- <Setter Property="Template" Value="{StaticResource ListBoxItemControlTemplate}" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
- <StackPanel Grid.Row="0" Margin="16,5,16,12">
- <TextBlock
- FontFamily="Segoe UI"
- FontSize="12"
- FontWeight="SemiBold"
- Foreground="{StaticResource color.sys.text.neutral.lv2}"
- Text="{x:Static mainpage:MainPage.PageEdit_PageSize}" />
- <StackPanel
- Margin="0,10"
- VerticalAlignment="Bottom"
- Orientation="Horizontal">
- <RadioButton
- Height="32"
- VerticalContentAlignment="Center"
- Content="{x:Static mainpage:MainPage.PageEdit_CurrentPage}"
- FontFamily="Segoe UI"
- FontSize="14"
- GroupName="PageSize"
- IsChecked="{Binding IsCurrentSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- IsEnabled="{Binding IsCurrentIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- <Label
- Height="32"
- Margin="8,0"
- HorizontalAlignment="Center"
- VerticalContentAlignment="Center"
- Content="{Binding CurrentPageSize}"
- FontFamily="Segoe UI"
- FontSize="14" />
- </StackPanel>
- <StackPanel Margin="0,10" Orientation="Horizontal">
- <RadioButton
- Name="RbtnStandard"
- VerticalAlignment="Center"
- Content="{x:Static mainpage:MainPage.PageEdit_Standard}"
- FontFamily="Segoe UI"
- FontSize="14"
- GroupName="PageSize"
- IsChecked="{Binding IsStandSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- <ComboBox
- Width="228"
- Height="32"
- Margin="8,0"
- IsEnabled="{Binding ElementName=RbtnStandard, Path=IsChecked}"
- ItemsSource="{Binding PageSize}"
- SelectedIndex="{Binding PageSizeSelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </StackPanel>
- <StackPanel Margin="0,10" Orientation="Horizontal">
- <RadioButton
- Name="RbtnCustom"
- VerticalAlignment="Center"
- Content="{x:Static mainpage:MainPage.PageEdit_InsertaCustomPage}"
- FontFamily="Segoe UI"
- FontSize="14"
- GroupName="PageSize"
- IsChecked="{Binding IsCustomSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- <!--<TextBox
- Width="94"
- Height="32"
- Margin="8,0"
- VerticalContentAlignment="Center"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- Style="{StaticResource TextBoxStyle}"
- Text="{Binding CustomWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
- <TextBox
- Width="94"
- Height="32"
- Margin="8,0"
- Padding="8,0"
- HorizontalContentAlignment="Left"
- VerticalContentAlignment="Center"
- Background="{StaticResource color.field.bg.def}"
- BorderBrush="{StaticResource color.field.border.norm}"
- InputMethod.IsInputMethodEnabled="False"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- Text="{Binding CustomWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
- <TextBox.Resources>
- <Style TargetType="{x:Type Border}">
- <Setter Property="CornerRadius" Value="4" />
- </Style>
- </TextBox.Resources>
- </TextBox>
- <TextBlock
- Margin="5,0"
- VerticalAlignment="Center"
- FontFamily="Segoe UI"
- FontSize="14"
- Text="X" />
- <!--<TextBox
- Width="80"
- Height="32"
- Margin="8,0"
- VerticalContentAlignment="Center"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- Text="{Binding CustomHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
- <TextBox
- Width="94"
- Height="32"
- Margin="8,0"
- Padding="8,0"
- HorizontalContentAlignment="Left"
- VerticalContentAlignment="Center"
- Background="{StaticResource color.field.bg.def}"
- BorderBrush="{StaticResource color.field.border.norm}"
- InputMethod.IsInputMethodEnabled="False"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- Text="{Binding CustomHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
- <TextBox.Resources>
- <Style TargetType="{x:Type Border}">
- <Setter Property="CornerRadius" Value="4" />
- </Style>
- </TextBox.Resources>
- </TextBox>
- <ComboBox
- Width="94"
- Margin="8,0"
- VerticalContentAlignment="Center"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- ItemsSource="{Binding Units}"
- SelectedIndex="{Binding UnitsSelectedIndex}" />
- </StackPanel>
- </StackPanel>
- <StackPanel Grid.Row="1" Margin="16,0">
- <TextBlock
- FontFamily="Segoe UI"
- FontSize="12"
- FontWeight="SemiBold"
- Foreground="{StaticResource color.sys.text.neutral.lv2}"
- Text="{x:Static mainpage:MainPage.Print_Orientation}" />
- <StackPanel Orientation="Horizontal">
- <RadioButton
- Width="105"
- Margin="0,12,0,16"
- VerticalContentAlignment="Center"
- Content="{x:Static mainpage:MainPage.PageEdit_VerticalPage}"
- FontFamily="Segoe UI"
- FontSize="14"
- GroupName="Direction"
- IsChecked="{Binding IsVerticalSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- Tag="Vertical" />
- <RadioButton
- Width="120"
- Margin="30,12,0,16"
- VerticalContentAlignment="Center"
- Content="{x:Static mainpage:MainPage.PageEdit_HorizontalPage}"
- FontFamily="Segoe UI"
- FontSize="14"
- GroupName="Direction"
- IsChecked="{Binding IsHorizontalSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- Tag="Horizontal" />
- </StackPanel>
- </StackPanel>
- </Grid>
- </cus:DialogContent.Content>
- <cus:DialogContent.BottmBar>
- <Grid>
- <Button
- Width="98"
- Height="32"
- Margin="16,0"
- HorizontalAlignment="Right"
- Command="{Binding CancelCommand}"
- Content="{x:Static mainpage:MainPage.PageEdit_Cancel}"
- Style="{StaticResource btn.sec}" />
- <Button
- Width="98"
- Height="32"
- Margin="124,0"
- HorizontalAlignment="Right"
- Command="{Binding InsertCommnad}"
- Content="{x:Static mainpage:MainPage.PageEdit_Insert}"
- Style="{StaticResource Btn.cta}" />
- </Grid>
- </cus:DialogContent.BottmBar>
- </cus:DialogContent>
- </UserControl>
|