123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <UserControl
- x:Class="PDF_Master.Views.BOTA.BookmarkContent"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:CustomControl="clr-namespace:PDF_Master.CustomControl"
- xmlns:bota="clr-namespace:PDF_Master.ViewModels.BOTA"
- xmlns:convert="clr-namespace:PDF_Master.DataConvert"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:data="clr-namespace:ComPDFKit.PDFDocument;assembly=ComPDFKit.Desk"
- xmlns:helper="clr-namespace:PDF_Master.Helper"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Master.Views.BOTA"
- xmlns:mainPageLoader="clr-namespace:PDF_Master.Strings.MainPage"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- d:DataContext="{d:DesignInstance Type=bota:BookmarkContentViewModel}"
- d:DesignHeight="450"
- d:DesignWidth="300"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/Styles/ListViewStyle.xaml" />
- <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
- <convert:UnVisivleConvert x:Key="UnVisivleConvert" />
- <convert:ObjectConvert x:Key="ObjectConvert" />
- <DataTemplate x:Key="myDataTemplate" DataType="{x:Type data:CPDFBookmark}">
- <StackPanel
- Name="StackPanel"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <Grid Name="Grid" Margin="15,5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="10*" />
- <ColumnDefinition Width="90*" />
- </Grid.ColumnDefinitions>
- <!--<Image
- Grid.Column="0"
- Width="16"
- Height="16"
- Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />-->
- <Path
- Grid.Column="0"
- Width="16"
- Height="16"
- Margin="0,9,0,0"
- VerticalAlignment="Top"
- Data="M3 3.47368C3 2.65979 3.65979 2 4.47368 2H11.5263C12.3402 2 13 2.65979 13 3.47368V14.3044C13 14.9486 12.2314 15.2826 11.7604 14.843L8.50276 11.8026C8.21966 11.5384 7.78034 11.5384 7.49724 11.8026L4.2396 14.843C3.7686 15.2826 3 14.9486 3 14.3044V3.47368Z"
- Fill="#94989C">
- <Path.RenderTransform>
- <TransformGroup>
- <TranslateTransform Y="-3" />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- <Grid Grid.Column="1" Visibility="{Binding ElementName=TxbTitle, Path=Visibility, Mode=TwoWay, Converter={StaticResource UnVisivleConvert}}">
- <TextBox
- x:Name="TxtTitleInput"
- Padding="5"
- HorizontalContentAlignment="Left"
- Background="White"
- BorderThickness="1"
- FontSize="14"
- Style="{StaticResource TextBoxStyleRadius}"
- Text="{Binding Title}"
- TextWrapping="Wrap">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="KeyDown">
- <i:InvokeCommandAction Command="{Binding DataContext.KeyDownCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </TextBox>
- </Grid>
- <TextBlock
- Name="TxbTitle"
- Grid.Column="1"
- Padding="5"
- Background="Transparent"
- FontSize="14"
- Text="{Binding Title}"
- TextWrapping="Wrap"
- Visibility="Visible" />
- </Grid>
- </StackPanel>
- </DataTemplate>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid MinHeight="500" Background="{StaticResource color.sys.layout.mg}">
- <Grid.RowDefinitions>
- <RowDefinition Height="48" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Border BorderBrush="{StaticResource color.field.border.norm}" BorderThickness="0,0,0,1">
- <Grid MinWidth="190">
- <TextBlock
- x:Name="TxtTitle"
- Margin="16,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontFamily="Segoe UI"
- FontSize="14"
- FontWeight="SemiBold"
- Foreground="{StaticResource color.sys.text.neutral.lv1}"
- Text="Bookmark" />
- <Button
- Name="BtnAddBookmark"
- Width="40"
- Height="40"
- Margin="0,0,0,0"
- HorizontalAlignment="Right"
- Click="BtnAddBookmark_Click"
- Style="{StaticResource PageEditToolBtn}">
- <Path Data="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z" Fill="#616469">
- <Path.RenderTransform>
- <TransformGroup>
- <TranslateTransform Y="-3" />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Button>
- </Grid>
- </Border>
- <Grid Grid.Row="1">
- <!--
- VirtualizingPanel.CacheLength="1"
- VirtualizingPanel.CacheLengthUnit="Page"
- VirtualizingPanel.IsVirtualizing="True"
- VirtualizingPanel.ScrollUnit="Pixel"
- -->
- <ListBox
- Name="BookMarkListView"
- HorizontalContentAlignment="Stretch"
- Background="{StaticResource color.sys.layout.mg}"
- BorderThickness="0"
- ItemTemplate="{StaticResource myDataTemplate}"
- ItemsSource="{Binding Bookmarklist}"
- PreviewMouseDown="BookMarkListView_PreviewMouseDown"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- SelectionChanged="BookMarkListView_SelectionChanged"
- SelectionMode="Extended">
- <ListBox.ContextMenu>
- <ContextMenu x:Name="ContextMenuBook" FontSize="14" Visibility="Collapsed">
- <MenuItem Click="MenuItemRename_Click" Header="{x:Static mainPageLoader:MainPage.Bookmark_Rename}" />
- <MenuItem Click="MenuChangeItem_Click" Header="{x:Static mainPageLoader:MainPage.Bookmark_Change}" />
- <MenuItem Click="MenuItemDeleteCommand_Click" Header="{x:Static mainPageLoader:MainPage.Bookmark_Delete}" />
- </ContextMenu>
- </ListBox.ContextMenu>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <VirtualizingStackPanel Margin="-5,0,0,0" Background="Transparent" />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemContainerStyle>
- <Style BasedOn="{StaticResource ListBoxItemGraySelectStyle}" TargetType="ListBoxItem">
- <EventSetter Event="PreviewMouseDown" Handler="ListViewItem_MouseButtonDown" />
- <EventSetter Event="LostFocus" Handler="ListViewItem_LostFocus" />
- <!--<Setter Property="ContextMenu" Value="{StaticResource ContextMenuBook}" />-->
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </Grid>
- <StackPanel
- Name="EmptyPanel"
- Grid.RowSpan="2"
- Width="150"
- VerticalAlignment="Center"
- Visibility="{Binding IsEmptyPanelVisibility}">
- <Image
- Width="128"
- Height="128"
- Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
- <TextBlock
- Name="txtEmpty"
- Margin="0,12,0,0"
- FontFamily="Segoe UI"
- FontSize="14"
- Foreground="{StaticResource color.sys.text.neutral.lv2}"
- Text="{Binding T_EmptyTitle}"
- TextAlignment="Center" />
- <TextBlock
- Name="txtEmpty2"
- Margin="0,12,0,0"
- FontFamily="Segoe UI"
- FontSize="14"
- Foreground="{StaticResource color.sys.text.neutral.lv3}"
- Text="{Binding T_EmptyContext}"
- TextAlignment="Center"
- TextWrapping="Wrap" />
- </StackPanel>
- </Grid>
- </UserControl>
|