|
@@ -9,20 +9,20 @@
|
|
|
mc:Ignorable="d"
|
|
|
d:DesignHeight="720"
|
|
|
d:DesignWidth="260" >
|
|
|
- <UserControl.Resources>
|
|
|
- <ContextMenu x:Key="FlyoutMenu" FontSize="14" >
|
|
|
- <ContextMenu.ItemContainerStyle>
|
|
|
- <Style TargetType="{x:Type MenuItem}">
|
|
|
- <Setter Property="Padding" Value="0,8,0,8"/>
|
|
|
- <Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
- </Style>
|
|
|
- </ContextMenu.ItemContainerStyle>
|
|
|
- <MenuItem Name="MenuEdit" Header="编辑模板" Click="MenuEdit_Click" >
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Name="MenuDeleteCurrent" Header="删除模板" Click="MenuDeleteCurrent_Click">
|
|
|
- </MenuItem>
|
|
|
- <MenuItem Name="MenuDeleteAll" Header="删除全部" Click="MenuDeleteAll_Click"></MenuItem>
|
|
|
- </ContextMenu>
|
|
|
+ <UserControl.Resources>
|
|
|
+ <ContextMenu x:Key="FlyoutMenu" FontSize="14" >
|
|
|
+ <ContextMenu.ItemContainerStyle>
|
|
|
+ <Style TargetType="{x:Type MenuItem}">
|
|
|
+ <Setter Property="Padding" Value="0,8,0,8"/>
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
+ </Style>
|
|
|
+ </ContextMenu.ItemContainerStyle>
|
|
|
+ <MenuItem Name="MenuEdit" Header="编辑模板" Click="MenuEdit_Click" >
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Name="MenuDeleteCurrent" Header="删除模板" Click="MenuDeleteCurrent_Click">
|
|
|
+ </MenuItem>
|
|
|
+ <MenuItem Name="MenuDeleteAll" Header="删除全部" Click="MenuDeleteAll_Click"></MenuItem>
|
|
|
+ </ContextMenu>
|
|
|
</UserControl.Resources>
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
@@ -36,93 +36,93 @@
|
|
|
<Button Height="20" Width="20" Margin="16,0,16,0" Command="{Binding EnterCreateCommand}"></Button>
|
|
|
</StackPanel>
|
|
|
</Grid>
|
|
|
- <Grid Background="#F3F3F3" Grid.Row="1">
|
|
|
- <ListBox
|
|
|
- Width="260"
|
|
|
- BorderThickness="0"
|
|
|
- ScrollViewer.CanContentScroll="True"
|
|
|
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
- ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
|
|
- VirtualizingPanel.IsVirtualizing="True"
|
|
|
- VirtualizingPanel.VirtualizationMode="Standard"
|
|
|
- VirtualizingPanel.CacheLengthUnit="Page"
|
|
|
- VirtualizingPanel.CacheLength="1"
|
|
|
- VirtualizingPanel.ScrollUnit="Pixel"
|
|
|
- Background="#F3F3F3"
|
|
|
- ItemsSource="{Binding BatesModCollection}"
|
|
|
- SelectionChanged="ListBox_SelectionChanged">
|
|
|
-
|
|
|
- <ListBox.ItemContainerStyle>
|
|
|
- <Style TargetType="ListBoxItem">
|
|
|
- <Setter Property="Margin" Value="11"/>
|
|
|
- <Setter Property="Padding" Value="0 0 0 0"/>
|
|
|
- <Setter Property="Width" Value="238"/>
|
|
|
- <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}"/>
|
|
|
- <Setter Property="Template" Value="{DynamicResource EditToolsItemControlTemplate}"/>
|
|
|
- </Style>
|
|
|
- </ListBox.ItemContainerStyle>
|
|
|
- <ListBox.ItemTemplate>
|
|
|
- <DataTemplate DataType="{x:Type data:BatesHeaderFooterItem}">
|
|
|
- <StackPanel Name="itemPanel" Loaded="itemPanel_Loaded">
|
|
|
- <Border BorderThickness="1" BorderBrush="#A0A2AE">
|
|
|
- <Grid Width="238" HorizontalAlignment="Left">
|
|
|
- <StackPanel >
|
|
|
- <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
|
|
|
- <TextBlock Text="Bates名称" Height="22" Width="98" FontSize="14" FontWeight="Black"></TextBlock>
|
|
|
- <TextBlock Name="TemplateIndexTextBox" FontSize="14" ></TextBlock>
|
|
|
- </StackPanel>
|
|
|
- <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
|
|
|
- <TextBlock Text="左侧页眉:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
- <TextBlock Name="LeftHeaderTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22" ></TextBlock>
|
|
|
- </StackPanel>
|
|
|
- <StackPanel Orientation="Horizontal" Margin="0,4,0,0">
|
|
|
- <TextBlock Text="右侧页眉:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
- <TextBlock Name="RightHeaderTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
- </StackPanel>
|
|
|
- <StackPanel Orientation="Horizontal" Margin="0,4,0,0">
|
|
|
- <TextBlock Text="中间页眉:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
- <TextBlock Name="CenterHeaderTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
- </StackPanel>
|
|
|
- <StackPanel Orientation="Horizontal" Margin="0,4,0,0">
|
|
|
- <TextBlock Text="左侧页脚:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
- <TextBlock Name="LeftFooterTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
- </StackPanel>
|
|
|
- <StackPanel Orientation="Horizontal" Margin="0,4,0,0">
|
|
|
- <TextBlock Text="右侧页脚:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
- <TextBlock Name="RightFooterTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
- </StackPanel>
|
|
|
- <StackPanel Orientation="Horizontal" Margin="0,4,0,0">
|
|
|
- <TextBlock Text="中间页脚:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
- <TextBlock Name="CenterFooterTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
- </StackPanel>
|
|
|
-
|
|
|
- </StackPanel>
|
|
|
- <Button Name="EditTemplateBtn" Height="43" Width="63" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
|
|
|
- <Button Name="DeleteTemplateBtn" Height="43" Width="63" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click">
|
|
|
- </Button>
|
|
|
- </Grid>
|
|
|
- </Border>
|
|
|
- </StackPanel>
|
|
|
- <DataTemplate.Triggers>
|
|
|
- <Trigger Property="IsMouseOver" Value="True">
|
|
|
- <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
|
|
|
- <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
|
|
|
- </Trigger>
|
|
|
- <Trigger Property="IsMouseOver" Value="False">
|
|
|
- <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Collapsed"/>
|
|
|
- <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Collapsed"/>
|
|
|
- </Trigger>
|
|
|
- </DataTemplate.Triggers>
|
|
|
- </DataTemplate>
|
|
|
- </ListBox.ItemTemplate>
|
|
|
- </ListBox>
|
|
|
- <Grid Width="140" Margin="64,153,56,0" Visibility="{Binding CreateTemplateVisible, Mode=OneWay}">
|
|
|
- <StackPanel Orientation="Vertical">
|
|
|
- <Label Height="87" Width="87" HorizontalAlignment="Center" Background="BlueViolet"></Label>
|
|
|
- <TextBlock Height="24" FontSize="14" Text="请先创建一个Bates模板" Margin="0,8,0,0" VerticalAlignment="Center" ></TextBlock>
|
|
|
- <Button Height="24" Width="44" Margin="0,12,0,0" Content ="新建" Command="{Binding AddTemplateCommand}"></Button>
|
|
|
- </StackPanel>
|
|
|
- </Grid>
|
|
|
+ <Grid Background="#F3F3F3" Grid.Row="1">
|
|
|
+ <ListBox
|
|
|
+ Width="260"
|
|
|
+ BorderThickness="0"
|
|
|
+ ScrollViewer.CanContentScroll="True"
|
|
|
+ ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
+ ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
|
|
+ VirtualizingPanel.IsVirtualizing="True"
|
|
|
+ VirtualizingPanel.VirtualizationMode="Standard"
|
|
|
+ VirtualizingPanel.CacheLengthUnit="Page"
|
|
|
+ VirtualizingPanel.CacheLength="1"
|
|
|
+ VirtualizingPanel.ScrollUnit="Pixel"
|
|
|
+ Background="#F3F3F3"
|
|
|
+ ItemsSource="{Binding BatesModCollection}"
|
|
|
+ SelectionChanged="ListBox_SelectionChanged">
|
|
|
+
|
|
|
+ <ListBox.ItemContainerStyle>
|
|
|
+ <Style TargetType="ListBoxItem">
|
|
|
+ <Setter Property="Margin" Value="11"/>
|
|
|
+ <Setter Property="Padding" Value="0 0 0 0"/>
|
|
|
+ <Setter Property="Width" Value="238"/>
|
|
|
+ <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}"/>
|
|
|
+ <Setter Property="Template" Value="{DynamicResource EditToolsItemControlTemplate}"/>
|
|
|
+ </Style>
|
|
|
+ </ListBox.ItemContainerStyle>
|
|
|
+ <ListBox.ItemTemplate>
|
|
|
+ <DataTemplate DataType="{x:Type data:BatesHeaderFooterItem}">
|
|
|
+ <StackPanel Name="itemPanel" Loaded="itemPanel_Loaded">
|
|
|
+ <Border BorderThickness="1" BorderBrush="#A0A2AE">
|
|
|
+ <Grid Width="238" HorizontalAlignment="Left">
|
|
|
+ <StackPanel >
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
|
|
|
+ <TextBlock Text="页眉页脚名称" Height="22" Width="98" FontSize="14" FontWeight="Black"></TextBlock>
|
|
|
+ <TextBlock Name="TemplateIndexTextBox" FontSize="14" ></TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="0,8,0,0" Visibility="{Binding ElementName=LeftHeaderTextBox,Path=Visibility}">
|
|
|
+ <TextBlock Text="左侧页眉:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
+ <TextBlock Name="LeftHeaderTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22" ></TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="0,4,0,0" Visibility="{Binding ElementName=RightHeaderTextBox,Path=Visibility}">
|
|
|
+ <TextBlock Text="右侧页眉:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
+ <TextBlock Name="RightHeaderTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="0,4,0,0" Visibility="{Binding ElementName=CenterHeaderTextBox,Path=Visibility}">
|
|
|
+ <TextBlock Text="中间页眉:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
+ <TextBlock Name="CenterHeaderTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="0,4,0,0" Visibility="{Binding ElementName=LeftFooterTextBox,Path=Visibility}">
|
|
|
+ <TextBlock Text="左侧页脚:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
+ <TextBlock Name="LeftFooterTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="0,4,0,0" Visibility="{Binding ElementName=RightFooterTextBox,Path=Visibility}">
|
|
|
+ <TextBlock Text="右侧页脚:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
+ <TextBlock Name="RightFooterTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+ <StackPanel Orientation="Horizontal" Margin="0,4,0,0" Visibility="{Binding ElementName=CenterFooterTextBox,Path=Visibility}">
|
|
|
+ <TextBlock Text="中间页脚:" FontSize="14" Height="22" Width="70"></TextBlock>
|
|
|
+ <TextBlock Name="CenterFooterTextBox" FontSize="14" Margin="8,0,0,0" Width="149" Height="22"></TextBlock>
|
|
|
+ </StackPanel>
|
|
|
+
|
|
|
+ </StackPanel>
|
|
|
+ <Button Name="EditTemplateBtn" Height="43" Width="63" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
|
|
|
+ <Button Name="DeleteTemplateBtn" Height="43" Width="63" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click">
|
|
|
+ </Button>
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+ </StackPanel>
|
|
|
+ <DataTemplate.Triggers>
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
+ <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
|
|
|
+ <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="IsMouseOver" Value="False">
|
|
|
+ <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Collapsed"/>
|
|
|
+ <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Collapsed"/>
|
|
|
+ </Trigger>
|
|
|
+ </DataTemplate.Triggers>
|
|
|
+ </DataTemplate>
|
|
|
+ </ListBox.ItemTemplate>
|
|
|
+ </ListBox>
|
|
|
+ <Grid Width="140" Margin="64,153,56,0" Visibility="{Binding CreateTemplateVisible, Mode=OneWay}">
|
|
|
+ <StackPanel Orientation="Vertical">
|
|
|
+ <Label Height="87" Width="87" HorizontalAlignment="Center" Background="BlueViolet"></Label>
|
|
|
+ <TextBlock Height="24" FontSize="14" Text="请先创建一个Bates模板" Margin="0,8,0,0" VerticalAlignment="Center" ></TextBlock>
|
|
|
+ <Button Height="24" Width="44" Margin="0,12,0,0" Content ="新建" Command="{Binding AddTemplateCommand}"></Button>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
</Grid>
|
|
|
</Grid>
|
|
|
</UserControl>
|