123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <UserControl
- x:Class="PDF_Office.Views.BOTA.BookmarkContent"
- 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/"
- 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="/Styles/ListViewStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
- <convert:UnVisivleConvert x:Key="UnVisivleConvert" />
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid Background="#F2F2F2">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid MinWidth="190">
- <TextBlock
- x:Name="TxtTitle"
- Margin="12,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="18"
- FontWeight="SemiBold"
- Text="Bookmarks" />
- <Button
- Name="BtnAddBookmark"
- Width="40"
- Height="40"
- Margin="0,0,0,0"
- HorizontalAlignment="Right"
- Content="添加" Command="{Binding AddBookmarkCommand}">
- </Button>
- </Grid>
- <Grid Grid.Row="1">
- <ListView
- Name="BookMarkListView"
- HorizontalContentAlignment="Stretch"
- Background="#F2F2F2"
- BorderThickness="0"
- ItemsSource="{Binding Bookmarklist}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- VirtualizingPanel.CacheLength="1"
- VirtualizingPanel.CacheLengthUnit="Page"
- VirtualizingPanel.IsVirtualizing="True"
- VirtualizingPanel.ScrollUnit="Pixel">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <VirtualizingStackPanel Margin="-5,0,0,0" Background="Transparent" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
- <ListView.ItemTemplate>
- <DataTemplate DataType="{x:Type data:CPDFBookmark}">
- <Grid
- Name="itemGrid"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Background="#F2F2F2">
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- </Grid.RowDefinitions>
- <StackPanel Name="StackPanel" Margin="15,5">
- <!-- IsHitTestVisible="False" -->
- <TextBlock
- Name="TextBlockTitle"
- Padding="5"
- Background="Transparent"
- FontSize="14"
- Text="{Binding Title}"
- Visibility="Visible" />
- <TextBox
- Name="TitleInput"
- Padding="5"
- Background="White"
- BorderThickness="1"
- FontSize="14"
- IsVisibleChanged="TitleInput_IsVisibleChanged"
- Text="{Binding Title}"
- TextWrapping="Wrap"
- Visibility="{Binding ElementName=TextBlockTitle, Path=Visibility, Converter={StaticResource UnVisivleConvert}, Mode=TwoWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="LostFocus">
- <i:InvokeCommandAction Command="{Binding DataContext.LostFocusCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- <i:EventTrigger EventName="GotFocus">
- <i:InvokeCommandAction Command="{Binding DataContext.GotFocusCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- <i:EventTrigger EventName="MouseEnter">
- <i:InvokeCommandAction Command="{Binding DataContext.MouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <!--<TextBox.Resources>
- <Style TargetType="{x:Type Border}">
- <Setter Property="CornerRadius" Value="2" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush" Value="#000000" />
- </Style>
- </TextBox.Resources>-->
- <!--<i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseDoubleClick">
- <helper:SetterAction>
- <helper:SetterAction.Setters>
- <Setter Property="TextBox.IsReadOnly" Value="False" />
- <Setter Property="TextBox.Background" Value="#FFFFFF" />
- <Setter Property="TextBox.BorderBrush" Value="#000000" />
- <Setter Property="TextBox.BorderThickness" Value="1px" />
- </helper:SetterAction.Setters>
- </helper:SetterAction>
- </i:EventTrigger>
- <i:EventTrigger EventName="MouseEnter">
- <i:EventTrigger.Actions>
- <helper:SetterAction>
- <helper:SetterAction.Setters>
- <Setter Property="TextBox.IsReadOnly" Value="true" />
- <Setter Property="TextBox.Background" Value="Transparent" />
- <Setter Property="TextBox.BorderBrush" Value="Transparent" />
- <Setter Property="TextBox.BorderThickness" Value="0px" />
- </helper:SetterAction.Setters>
- </helper:SetterAction>
- </i:EventTrigger.Actions>
- </i:EventTrigger>
- <i:EventTrigger EventName="MouseLeave">
- <i:EventTrigger.Actions>
- <helper:SetterAction>
- <helper:SetterAction.Setters>
- <Setter Property="TextBox.IsReadOnly" Value="true" />
- <Setter Property="TextBox.Background" Value="Transparent" />
- <Setter Property="TextBox.BorderBrush" Value="Transparent" />
- <Setter Property="TextBox.BorderThickness" Value="0px" />
- </helper:SetterAction.Setters>
- </helper:SetterAction>
- </i:EventTrigger.Actions>
- </i:EventTrigger>
- <i:EventTrigger EventName="LostFocus">
- <i:EventTrigger.Actions>
- <helper:SetterAction>
- <helper:SetterAction.Setters>
- <Setter Property="TextBox.IsReadOnly" Value="true" />
- <Setter Property="TextBox.Background" Value="Transparent" />
- <Setter Property="TextBox.BorderBrush" Value="Transparent" />
- <Setter Property="TextBox.BorderThickness" Value="0px" />
- </helper:SetterAction.Setters>
- </helper:SetterAction>
- </i:EventTrigger.Actions>
- </i:EventTrigger>
- </i:Interaction.Triggers>-->
- </TextBox>
- </StackPanel>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseDown">
- <i:InvokeCommandAction Command="{Binding DataContext.MouseClickCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- <i:EventTrigger EventName="MouseEnter">
- <i:InvokeCommandAction Command="{Binding DataContext.MouseEnterCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- <i:EventTrigger EventName="MouseMove">
- <i:InvokeCommandAction Command="{Binding DataContext.MouseMoveCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- <!--<i:EventTrigger EventName="LostFocus">
- <i:InvokeCommandAction Command="{Binding DataContext.LostFocusCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>-->
- </i:Interaction.Triggers>
- </Grid>
- </DataTemplate>
- </ListView.ItemTemplate>
- <ListView.ItemContainerStyle>
- <Style BasedOn="{StaticResource ListViewItemGraySelectStyle}" TargetType="ListViewItem">
- <!--<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListViewItem_PreviewMouseLeftButtonDown" />
- <EventSetter Event="Unselected" Handler="ListViewItem_Unselected" />-->
- </Style>
- </ListView.ItemContainerStyle>
- </ListView>
- </Grid>
- <StackPanel
- Name="EmptyPanel"
- Grid.RowSpan="2"
- Width="150"
- VerticalAlignment="Center"
- Visibility="{Binding IsEmptyPanelVisibility}">
- <Image
- Width="140"
- Height="140"
- Source="\Resources\BOTA\empty_bookmark.png" />
- <TextBlock
- Name="txtEmpty"
- Margin="0,12,0,0"
- FontFamily="Segoe UI"
- FontSize="16"
- Text="No bookmark"
- TextAlignment="Center" />
- </StackPanel>
- </Grid>
- </UserControl>
|