123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- <UserControl
- x:Class="PDF_Office.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_Office.DataConvert"
- xmlns:cus="clr-namespace:PDF_Office.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:model="clr-namespace:PDF_Office.Model.PageEdit"
- xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
- xmlns:prism="http://prismlibrary.com/"
- Width="480"
- Height="472"
- d:DataContext="{d:DesignInstance Type=pageeditdialogs:InsertDialogViewModel}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <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="插入自定义页面">
- <cus:DialogContent.Content>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- </Grid.RowDefinitions>
- <ListBox
- Padding="0,16,0,0"
- HorizontalAlignment="Center"
- BorderThickness="0"
- ItemTemplate="{StaticResource CustomItem}"
- ItemsSource="{Binding Pages}"
- SelectedIndex="{Binding ItemSelectedIndex, Mode=TwoWay}">
- <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="1" Margin="16,0">
- <TextBlock
- FontSize="14"
- FontWeight="SemiBold"
- Text="页面大小" />
- <StackPanel
- Margin="0,12,0,0"
- VerticalAlignment="Bottom"
- Orientation="Horizontal">
- <RadioButton
- Height="32"
- VerticalContentAlignment="Center"
- Content="当前页"
- GroupName="PageSize"
- IsChecked="True" />
- <Label
- Height="32"
- Margin="8,0"
- HorizontalAlignment="Center"
- VerticalContentAlignment="Center"
- Content="{Binding CurrentPageSize}"
- FontSize="14" />
- </StackPanel>
- <StackPanel Margin="0,12" Orientation="Horizontal">
- <RadioButton
- Name="RbtnStandard"
- VerticalAlignment="Center"
- Content="标准"
- GroupName="PageSize" />
- <ComboBox
- Width="228"
- Height="32"
- Margin="8,0"
- IsEnabled="{Binding ElementName=RbtnStandard, Path=IsChecked}" />
- </StackPanel>
- <StackPanel Margin="0,0,0,12" Orientation="Horizontal">
- <RadioButton
- Name="RbtnCustom"
- VerticalAlignment="Center"
- Content="自定义"
- GroupName="PageSize" />
- <TextBox
- Width="80"
- Height="32"
- Margin="8,0"
- VerticalContentAlignment="Center"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- Text="{Binding CustomWidth, Mode=TwoWay}" />
- <TextBlock VerticalAlignment="Center" Text="X" />
- <TextBox
- Width="80"
- Height="32"
- Margin="8,0"
- VerticalContentAlignment="Center"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- Text="{Binding CustomHeight, Mode=TwoWay}" />
- <ComboBox
- Width="80"
- VerticalContentAlignment="Center"
- IsEnabled="{Binding ElementName=RbtnCustom, Path=IsChecked}"
- ItemsSource="{Binding Units}"
- SelectedIndex="{Binding UnitsSelectedIndex}" />
- </StackPanel>
- </StackPanel>
- <StackPanel Grid.Row="2" Margin="16,0">
- <TextBlock
- FontSize="14"
- FontWeight="SemiBold"
- Text="方向" />
- <StackPanel Orientation="Horizontal">
- <RadioButton
- Margin="0,12,0,16"
- Content="纵向页面"
- IsChecked="True">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding OrientationCheckedCommand}" CommandParameter="Vertical" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton
- Margin="24,12,0,16"
- Content="横向页面"
- Tag="Vertical">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding OrientationCheckedCommand}" CommandParameter="Horizontal" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- </StackPanel>
- </StackPanel>
- </Grid>
- </cus:DialogContent.Content>
- <cus:DialogContent.BottmBar>
- <Grid>
- <Button
- Width="98"
- Height="32"
- Margin="16,0"
- HorizontalAlignment="Right"
- Command="{Binding CancelCommand}"
- Content="取消" />
- <Button
- Width="98"
- Height="32"
- Margin="124,0"
- HorizontalAlignment="Right"
- Command="{Binding InsertCommnad}"
- Content="插入" />
- </Grid>
- </cus:DialogContent.BottmBar>
- </cus:DialogContent>
- </UserControl>
|