123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <UserControl
- x:Class="PDF_Office.Views.BOTA.AnnotationContent"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:bota="clr-namespace:PDF_Office.ViewModels.BOTA"
- xmlns:convert="clr-namespace:PDF_Office.DataConvert"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:data="clr-namespace:ComPDFKit.PDFDocument;assembly=ComPDFKit.Desk"
- xmlns:helper="clr-namespace:PDF_Office.Helper"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:property="clr-namespace:PDF_Office.Properties"
- d:DataContext="{d:DesignInstance Type=bota:AnnotationContentViewModel}"
- d:DesignHeight="450"
- d:DesignWidth="300"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
- <ResourceDictionary Source="pack://application:,,,/Styles/ComboxStyle.xaml" />
- <ResourceDictionary Source="pack://application:,,,/Styles/ListViewStyle.xaml" />
- <ResourceDictionary Source="pack://application:,,,/Styles/ExpanderStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <DataTemplate x:Key="AnnotationListItemTemplate">
- <local:AnnotationListItem />
- </DataTemplate>
- <SolidColorBrush x:Key="path.fill" Color="#273C62" />
- <convert:IntToBooleanConvert x:Key="IntToBooleanConvert" />
- <convert:AnnotateFontSizeConverter x:Key="AnnotateFontSizeConverter" />
- <convert:GroupHeaderConverter x:Key="GroupHeaderConverter" />
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid Background="#F2F2F2">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid Name="TopGrid" MinWidth="240">
- <TextBlock
- x:Name="Title"
- Margin="12,0,0,0"
- VerticalAlignment="Center"
- FontSize="18"
- FontWeight="SemiBold"
- Text="Annotation"
- TextAlignment="Left" />
- <Button
- x:Name="BtnScreen"
- Width="40"
- Margin="0,0,70,0"
- HorizontalAlignment="Right"
- Content="筛选"
- Focusable="False"
- IsEnabled="{Binding ElementName=AnnotationList, Path=Items.Count, Converter={StaticResource IntToBooleanConvert}}"
- Style="{StaticResource PageEditToolBtn}" />
- <Button
- Name="BtnMore"
- Width="40"
- Margin="0,0,30,0"
- HorizontalAlignment="Right"
- IsEnabled="{Binding ElementName=AnnotationList, Path=Items.Count, Converter={StaticResource IntToBooleanConvert}}"
- Style="{StaticResource PageEditToolBtn}">
- <Path Data="M2,7 C2.140625,7 2.27083333,7.02604167 2.390625,7.078125 C2.51041667,7.13020833 2.61588542,7.20182292 2.70703125,7.29296875 C2.79817708,7.38411458 2.86979167,7.48958333 2.921875,7.609375 C2.97395833,7.72916667 3,7.859375 3,8 C3,8.140625 2.97395833,8.27083333 2.921875,8.390625 C2.86979167,8.51041667 2.79817708,8.61588542 2.70703125,8.70703125 C2.61588542,8.79817708 2.51041667,8.86979167 2.390625,8.921875 C2.27083333,8.97395833 2.140625,9 2,9 C1.859375,9 1.72916667,8.97395833 1.609375,8.921875 C1.48958333,8.86979167 1.38411458,8.79817708 1.29296875,8.70703125 C1.20182292,8.61588542 1.13020833,8.51041667 1.078125,8.390625 C1.02604167,8.27083333 1,8.140625 1,8 C1,7.859375 1.02604167,7.72916667 1.078125,7.609375 C1.13020833,7.48958333 1.20182292,7.38411458 1.29296875,7.29296875 C1.38411458,7.20182292 1.48958333,7.13020833 1.609375,7.078125 C1.72916667,7.02604167 1.859375,7 2,7 Z M8,7 C8.140625,7 8.27083333,7.02604167 8.390625,7.078125 C8.51041667,7.13020833 8.61588542,7.20182292 8.70703125,7.29296875 C8.79817708,7.38411458 8.86979167,7.48958333 8.921875,7.609375 C8.97395833,7.72916667 9,7.859375 9,8 C9,8.140625 8.97395833,8.27083333 8.921875,8.390625 C8.86979167,8.51041667 8.79817708,8.61588542 8.70703125,8.70703125 C8.61588542,8.79817708 8.51041667,8.86979167 8.390625,8.921875 C8.27083333,8.97395833 8.140625,9 8,9 C7.859375,9 7.72916667,8.97395833 7.609375,8.921875 C7.48958333,8.86979167 7.38411458,8.79817708 7.29296875,8.70703125 C7.20182292,8.61588542 7.13020833,8.51041667 7.078125,8.390625 C7.02604167,8.27083333 7,8.140625 7,8 C7,7.859375 7.02604167,7.72916667 7.078125,7.609375 C7.13020833,7.48958333 7.20182292,7.38411458 7.29296875,7.29296875 C7.38411458,7.20182292 7.48958333,7.13020833 7.609375,7.078125 C7.72916667,7.02604167 7.859375,7 8,7 Z M14,7 C14.140625,7 14.2708333,7.02604167 14.390625,7.078125 C14.5104167,7.13020833 14.6158854,7.20182292 14.7070313,7.29296875 C14.7981771,7.38411458 14.8697917,7.48958333 14.921875,7.609375 C14.9739583,7.72916667 15,7.859375 15,8 C15,8.140625 14.9739583,8.27083333 14.921875,8.390625 C14.8697917,8.51041667 14.7981771,8.61588542 14.7070313,8.70703125 C14.6158854,8.79817708 14.5104167,8.86979167 14.390625,8.921875 C14.2708333,8.97395833 14.140625,9 14,9 C13.859375,9 13.7291667,8.97395833 13.609375,8.921875 C13.4895833,8.86979167 13.3841146,8.79817708 13.2929688,8.70703125 C13.2018229,8.61588542 13.1302083,8.51041667 13.078125,8.390625 C13.0260417,8.27083333 13,8.140625 13,8 C13,7.859375 13.0260417,7.72916667 13.078125,7.609375 C13.1302083,7.48958333 13.2018229,7.38411458 13.2929688,7.29296875 C13.3841146,7.20182292 13.4895833,7.13020833 13.609375,7.078125 C13.7291667,7.02604167 13.859375,7 14,7 Z" Fill="{StaticResource BOTA.Path.Fill}">
- <Path.RenderTransform>
- <TransformGroup>
- <TranslateTransform Y="-3" />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <Button.ContextMenu>
- <ContextMenu
- Name="MenuMore"
- Width="auto"
- Style="{StaticResource ContextMenuStyle}">
- <ContextMenu.ItemContainerStyle>
- <Style TargetType="MenuItem">
- <Setter Property="Padding" Value="-25,7,-35,7" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
- </ContextMenu.ItemContainerStyle>
- <MenuItem
- Name="MenuExpandAll"
- Width="auto"
- Header="全部展开">
- <MenuItem.Icon>
- <Border Background="Transparent" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Name="MenuCollapseAll" Header="全部折叠" />
- <MenuItem Name="MenuSort">
- <MenuItem.Header>
- <TextBlock Name="MenuSortText" Text="排序" />
- </MenuItem.Header>
- <MenuItem Name="MenuPageSort" Padding="0,7,0,7">
- <MenuItem.Icon>
- <Path
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M10.807106,0.0999999046 L15.0999992,5.39289312 L15.0999992,15.8999991 L0.899999857,15.8999991 L0.899999857,0.0999999046 L10.807106,0.0999999046 Z M10.3929999,1.0999999 L1.89999986,1.0999999 L1.89999986,14.8989999 L14.0989999,14.8989999 L14.0989999,5.8059999 L10.3929999,1.0999999 Z M8,10.53125 C8.15885417,10.53125 8.29361979,10.5833333 8.40429688,10.6875 C8.51497396,10.7916667 8.5703125,10.9166667 8.5703125,11.0625 C8.5703125,11.2057292 8.51497396,11.328776 8.40429688,11.4316406 C8.29361979,11.5345052 8.15885417,11.5859375 8,11.5859375 C7.84375,11.5859375 7.7109375,11.5345052 7.6015625,11.4316406 C7.4921875,11.328776 7.4375,11.2057292 7.4375,11.0625 C7.4375,10.9166667 7.4921875,10.7916667 7.6015625,10.6875 C7.7109375,10.5833333 7.84375,10.53125 8,10.53125 Z M6.21875,5.7734375 L6.21875,11.5 L5.3125,11.5 L5.3125,6.8828125 C5.1484375,7 4.97200521,7.09960938 4.78320312,7.18164062 C4.59440104,7.26367188 4.37890625,7.3359375 4.13671875,7.3984375 L4.13671875,7.3984375 L4.13671875,6.625 C4.28776042,6.57552083 4.43359375,6.5234375 4.57421875,6.46875 C4.71484375,6.4140625 4.85351562,6.35286458 4.99023438,6.28515625 C5.12695312,6.21744792 5.26497396,6.14192708 5.40429688,6.05859375 C5.54361979,5.97526042 5.6875,5.88020833 5.8359375,5.7734375 L5.8359375,5.7734375 L6.21875,5.7734375 Z M11.3671875,5.7734375 L11.3671875,11.5 L10.4609375,11.5 L10.4609375,6.8828125 C10.296875,7 10.1204427,7.09960938 9.93164062,7.18164062 C9.74283854,7.26367188 9.52734375,7.3359375 9.28515625,7.3984375 L9.28515625,7.3984375 L9.28515625,6.625 C9.43619792,6.57552083 9.58203125,6.5234375 9.72265625,6.46875 C9.86328125,6.4140625 10.0019531,6.35286458 10.1386719,6.28515625 C10.2753906,6.21744792 10.4134115,6.14192708 10.5527344,6.05859375 C10.6920573,5.97526042 10.8359375,5.88020833 10.984375,5.7734375 L10.984375,5.7734375 L11.3671875,5.7734375 Z M8,7.44140625 C8.15885417,7.44140625 8.29361979,7.49348958 8.40429688,7.59765625 C8.51497396,7.70182292 8.5703125,7.82682292 8.5703125,7.97265625 C8.5703125,8.11588542 8.51497396,8.23893229 8.40429688,8.34179688 C8.29361979,8.44466146 8.15885417,8.49609375 8,8.49609375 C7.84375,8.49609375 7.7109375,8.44466146 7.6015625,8.34179688 C7.4921875,8.23893229 7.4375,8.11588542 7.4375,7.97265625 C7.4375,7.82682292 7.4921875,7.70182292 7.6015625,7.59765625 C7.7109375,7.49348958 7.84375,7.44140625 8,7.44140625 Z"
- Fill="Black" />
- </MenuItem.Icon>
- <MenuItem.Header>
- <TextBlock Name="MenuPageSortText" Text="按页面排序" />
- </MenuItem.Header>
- </MenuItem>
- <MenuItem Name="MenuTimeRightSort" Padding="0,7,0,7">
- <MenuItem.Icon>
- <Path
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M10.807106,0.0999999046 L15.0999992,5.39289312 L15.0999992,15.8999991 L0.899999857,15.8999991 L0.899999857,0.0999999046 L10.807106,0.0999999046 Z M10.3929999,1.0999999 L1.89999986,1.0999999 L1.89999986,14.8989999 L14.0989999,14.8989999 L14.0989999,5.8059999 L10.3929999,1.0999999 Z M8,10.53125 C8.15885417,10.53125 8.29361979,10.5833333 8.40429688,10.6875 C8.51497396,10.7916667 8.5703125,10.9166667 8.5703125,11.0625 C8.5703125,11.2057292 8.51497396,11.328776 8.40429688,11.4316406 C8.29361979,11.5345052 8.15885417,11.5859375 8,11.5859375 C7.84375,11.5859375 7.7109375,11.5345052 7.6015625,11.4316406 C7.4921875,11.328776 7.4375,11.2057292 7.4375,11.0625 C7.4375,10.9166667 7.4921875,10.7916667 7.6015625,10.6875 C7.7109375,10.5833333 7.84375,10.53125 8,10.53125 Z M6.21875,5.7734375 L6.21875,11.5 L5.3125,11.5 L5.3125,6.8828125 C5.1484375,7 4.97200521,7.09960938 4.78320312,7.18164062 C4.59440104,7.26367188 4.37890625,7.3359375 4.13671875,7.3984375 L4.13671875,7.3984375 L4.13671875,6.625 C4.28776042,6.57552083 4.43359375,6.5234375 4.57421875,6.46875 C4.71484375,6.4140625 4.85351562,6.35286458 4.99023438,6.28515625 C5.12695312,6.21744792 5.26497396,6.14192708 5.40429688,6.05859375 C5.54361979,5.97526042 5.6875,5.88020833 5.8359375,5.7734375 L5.8359375,5.7734375 L6.21875,5.7734375 Z M11.3671875,5.7734375 L11.3671875,11.5 L10.4609375,11.5 L10.4609375,6.8828125 C10.296875,7 10.1204427,7.09960938 9.93164062,7.18164062 C9.74283854,7.26367188 9.52734375,7.3359375 9.28515625,7.3984375 L9.28515625,7.3984375 L9.28515625,6.625 C9.43619792,6.57552083 9.58203125,6.5234375 9.72265625,6.46875 C9.86328125,6.4140625 10.0019531,6.35286458 10.1386719,6.28515625 C10.2753906,6.21744792 10.4134115,6.14192708 10.5527344,6.05859375 C10.6920573,5.97526042 10.8359375,5.88020833 10.984375,5.7734375 L10.984375,5.7734375 L11.3671875,5.7734375 Z M8,7.44140625 C8.15885417,7.44140625 8.29361979,7.49348958 8.40429688,7.59765625 C8.51497396,7.70182292 8.5703125,7.82682292 8.5703125,7.97265625 C8.5703125,8.11588542 8.51497396,8.23893229 8.40429688,8.34179688 C8.29361979,8.44466146 8.15885417,8.49609375 8,8.49609375 C7.84375,8.49609375 7.7109375,8.44466146 7.6015625,8.34179688 C7.4921875,8.23893229 7.4375,8.11588542 7.4375,7.97265625 C7.4375,7.82682292 7.4921875,7.70182292 7.6015625,7.59765625 C7.7109375,7.49348958 7.84375,7.44140625 8,7.44140625 Z"
- Fill="Black" />
- </MenuItem.Icon>
- <MenuItem.Header>
- <TextBlock Name="MenuTimeRightSortText" Text="按时间正序排列" />
- </MenuItem.Header>
- </MenuItem>
- <MenuItem Name="MenuTimeBackSort" Padding="0,7,0,7">
- <MenuItem.Icon>
- <Path
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M10.807106,0.0999999046 L15.0999992,5.39289312 L15.0999992,15.8999991 L0.899999857,15.8999991 L0.899999857,0.0999999046 L10.807106,0.0999999046 Z M10.3929999,1.0999999 L1.89999986,1.0999999 L1.89999986,14.8989999 L14.0989999,14.8989999 L14.0989999,5.8059999 L10.3929999,1.0999999 Z M8,10.53125 C8.15885417,10.53125 8.29361979,10.5833333 8.40429688,10.6875 C8.51497396,10.7916667 8.5703125,10.9166667 8.5703125,11.0625 C8.5703125,11.2057292 8.51497396,11.328776 8.40429688,11.4316406 C8.29361979,11.5345052 8.15885417,11.5859375 8,11.5859375 C7.84375,11.5859375 7.7109375,11.5345052 7.6015625,11.4316406 C7.4921875,11.328776 7.4375,11.2057292 7.4375,11.0625 C7.4375,10.9166667 7.4921875,10.7916667 7.6015625,10.6875 C7.7109375,10.5833333 7.84375,10.53125 8,10.53125 Z M6.21875,5.7734375 L6.21875,11.5 L5.3125,11.5 L5.3125,6.8828125 C5.1484375,7 4.97200521,7.09960938 4.78320312,7.18164062 C4.59440104,7.26367188 4.37890625,7.3359375 4.13671875,7.3984375 L4.13671875,7.3984375 L4.13671875,6.625 C4.28776042,6.57552083 4.43359375,6.5234375 4.57421875,6.46875 C4.71484375,6.4140625 4.85351562,6.35286458 4.99023438,6.28515625 C5.12695312,6.21744792 5.26497396,6.14192708 5.40429688,6.05859375 C5.54361979,5.97526042 5.6875,5.88020833 5.8359375,5.7734375 L5.8359375,5.7734375 L6.21875,5.7734375 Z M11.3671875,5.7734375 L11.3671875,11.5 L10.4609375,11.5 L10.4609375,6.8828125 C10.296875,7 10.1204427,7.09960938 9.93164062,7.18164062 C9.74283854,7.26367188 9.52734375,7.3359375 9.28515625,7.3984375 L9.28515625,7.3984375 L9.28515625,6.625 C9.43619792,6.57552083 9.58203125,6.5234375 9.72265625,6.46875 C9.86328125,6.4140625 10.0019531,6.35286458 10.1386719,6.28515625 C10.2753906,6.21744792 10.4134115,6.14192708 10.5527344,6.05859375 C10.6920573,5.97526042 10.8359375,5.88020833 10.984375,5.7734375 L10.984375,5.7734375 L11.3671875,5.7734375 Z M8,7.44140625 C8.15885417,7.44140625 8.29361979,7.49348958 8.40429688,7.59765625 C8.51497396,7.70182292 8.5703125,7.82682292 8.5703125,7.97265625 C8.5703125,8.11588542 8.51497396,8.23893229 8.40429688,8.34179688 C8.29361979,8.44466146 8.15885417,8.49609375 8,8.49609375 C7.84375,8.49609375 7.7109375,8.44466146 7.6015625,8.34179688 C7.4921875,8.23893229 7.4375,8.11588542 7.4375,7.97265625 C7.4375,7.82682292 7.4921875,7.70182292 7.6015625,7.59765625 C7.7109375,7.49348958 7.84375,7.44140625 8,7.44140625 Z"
- Fill="Black" />
- </MenuItem.Icon>
- <MenuItem.Header>
- <TextBlock Name="MenuTimeBackSortText" Text="按页面排序" />
- </MenuItem.Header>
- </MenuItem>
- </MenuItem>
- <MenuItem Name="MenuExport" Header="导出注释为XFDF格式" />
- <MenuItem Name="MenuDeleteAll" Header="删除所有注释" />
- </ContextMenu>
- </Button.ContextMenu>
- </Button>
- </Grid>
- <Grid Grid.Row="2">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="29*" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <ListBox
- x:Name="AnnotationList"
- Grid.ColumnSpan="3"
- HorizontalContentAlignment="Stretch"
- Background="#F2F2F2"
- BorderThickness="0"
- ItemTemplate="{StaticResource AnnotationListItemTemplate}"
- ItemsSource="{Binding AnnotationListItems}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- SelectionMode="Extended">
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
- <Setter Property="Template" Value="{StaticResource AnnotationListItemStyle}" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Margin" Value="0,-1,0,-1" />
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.GroupStyle>
- <GroupStyle>
- <GroupStyle.ContainerStyle>
- <Style TargetType="{x:Type GroupItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type GroupItem}">
- <Expander
- Name="Expander"
- Margin="-1,-1,-1,-1"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch"
- Style="{StaticResource GropExpanderHeader}">
- <Expander.Header>
- <Grid
- Height="25"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <Grid.RowDefinitions>
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock
- Name="GroupTitle"
- Margin="10,0,0,0"
- VerticalAlignment="Center"
- FontFamily="Segoe UI Semibold"
- FontSize="14"
- FontWeight="SemiBold"
- Text="{Binding Name, Converter={StaticResource GroupHeaderConverter}}"
- TextAlignment="Left" />
- <!--<TextBlock
- Name="Count"
- Margin="0,0,8,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontFamily="Segoe UI Semibold"
- FontSize="{Binding Source={x:Static property:Settings.Default}, Path=AnnotateFontSize, Converter={StaticResource AnnotateFontSizeConverter}}"
- FontWeight="SemiBold"
- Foreground="#FF666666"
- Text="{Binding ItemCount}"
- TextAlignment="Right" />-->
- </Grid>
- </Expander.Header>
- <ItemsPresenter />
- </Expander>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </GroupStyle.ContainerStyle>
- </GroupStyle>
- </ListBox.GroupStyle>
- <!--<ListBox.ContextMenu>
- <ContextMenu Loaded="ContextMenu_Loaded">
- <MenuItem
- Name="menuDelete"
- Click="MenuDelete_Click"
- Header="Delete" />
- </ContextMenu>
- </ListBox.ContextMenu>-->
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Loaded">
- <helper:AdvancedInvokeCommandAction
- Command="{Binding DataContext.LoadedCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
- CommandParameter="{Binding ElementName=AnnotationList}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ListBox>
- <StackPanel
- Name="EmptyPanel"
- Grid.ColumnSpan="2"
- VerticalAlignment="Center"
- Visibility="{Binding IsEmptyPanelVisibility}">
- <Image
- Width="140"
- Height="140"
- Source="pack://application:,,,/Resources/BOTA/empty_annotation.png" />
- <TextBlock
- Name="txtEmpty"
- Margin="0,12,0,0"
- FontFamily="Segoe UI"
- FontSize="16"
- Text="No comments added"
- TextAlignment="Center" />
- </StackPanel>
- </Grid>
- </Grid>
- </UserControl>
|