123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <UserControl
- x:Class="PDF_Office.Views.PageEdit.PageEditContent"
- 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:cussys="clr-namespace:PDF_Office.CustomControl.SystemControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Office.Views.PageEdit"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pageedit="clr-namespace:PDF_Office.Model.PageEdit"
- xmlns:pageedit1="clr-namespace:PDF_Office.ViewModels.PageEdit"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
- Name="PageEdit"
- d:DataContext="{d:DesignInstance Type=pageedit1:PageEditContentViewModel}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- prism:ViewModelLocator.AutoWireViewModel="True"
- IsVisibleChanged="PageEdit_IsVisibleChanged"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
- <DataTemplate x:Key="PageEditListBoxItemTemplate" DataType="{x:Type pageedit:PageEditItem}">
- <Grid Height="320">
- <Border
- Name="BdBorder"
- Height="auto"
- VerticalAlignment="Top"
- BorderBrush="Blue"
- BorderThickness="0"
- CornerRadius="0">
- <Grid
- Width="208"
- Height="294"
- Margin="1">
- <Image Source="{Binding Image}" />
- <Border
- Width="10"
- Height="10"
- Margin="0,10,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Background="Yellow"
- Visibility="{Binding HaveBookMark, Converter={StaticResource BoolToVisibleConvert}}" />
- </Grid>
- </Border>
- <Border
- Name="BdPageNum"
- Margin="0,4,0,0"
- VerticalAlignment="Bottom"
- Background="Transparent">
- <StackPanel
- Name="StkpnlButtom"
- Width="auto"
- MinWidth="116"
- HorizontalAlignment="Center"
- Background="Transparent">
- <TextBlock
- Width="auto"
- Height="22"
- HorizontalAlignment="Center"
- FontSize="14"
- Text="{Binding PageNumber}" />
- <TextBlock
- Width="auto"
- Height="22"
- HorizontalAlignment="Center"
- FontSize="14"
- Text="{Binding PageSize}"
- Visibility="{Binding ShowPageSize, Converter={StaticResource BoolToVisibleConvert}}" />
- </StackPanel>
- </Border>
- </Grid>
- <DataTemplate.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
- <Setter TargetName="BdBorder" Property="BorderThickness" Value="1" />
- <Setter TargetName="BdBorder" Property="CornerRadius" Value="4" />
- <Setter TargetName="BdPageNum" Property="Background" Value="Blue" />
- <Setter TargetName="BdPageNum" Property="CornerRadius" Value="4" />
- </DataTrigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </ResourceDictionary>
- </UserControl.Resources>
- <Border
- BorderBrush="#F2F2F2"
- BorderThickness="0,1,0,0"
- Visibility="{Binding IsVisible, Mode=TwoWay}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid Background="#FFFFFF">
- <StackPanel Name="StkpnlCenter" />
- <StackPanel Name="StkpnlRight" />
- </Grid>
- <ListBox
- Name="ListPageEdit"
- Grid.Row="1"
- Padding="0"
- AllowDrop="True"
- ItemTemplate="{StaticResource PageEditListBoxItemTemplate}"
- ItemsSource="{Binding PageEditItems}"
- ScrollBar.Scroll="ListPageEdit_Scroll"
- ScrollViewer.CanContentScroll="True"
- ScrollViewer.ScrollChanged="ListPageEdit_ScrollChanged"
- SelectedIndex="{Binding SelectedIndex}"
- SelectionMode="Extended"
- VirtualizingPanel.CacheLength="1"
- VirtualizingPanel.CacheLengthUnit="Page"
- VirtualizingPanel.ScrollUnit="Pixel"
- VirtualizingPanel.VirtualizationMode="Standard">
- <ListBox.ItemContainerStyle>
- <Style TargetType="{x:Type ListBoxItem}">
- <Setter Property="Template" Value="{StaticResource ListBoxItemControlTemplate}" />
- <Setter Property="Margin" Value="0,10" />
- <Setter Property="Visibility" Value="{Binding Visible}" />
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <wpftk:VirtualizingWrapPanel />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
- </Grid>
- </Border>
- </UserControl>
|