|
@@ -2,57 +2,19 @@
|
|
|
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:local="clr-namespace:PDF_Office.Views.BOTA"
|
|
|
- xmlns:convert="clr-namespace:PDF_Office.DataConvert"
|
|
|
- xmlns:data ="clr-namespace:ComPDFKit.PDFDocument;assembly=ComPDFKit.Desk"
|
|
|
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>
|
|
|
- <ControlTemplate x:Key="textbox" TargetType="{x:Type TextBoxBase}">
|
|
|
- <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
|
|
|
- BorderBrush="{TemplateBinding Border.BorderBrush}"
|
|
|
- Background="{TemplateBinding Panel.Background}"
|
|
|
- Name="border"
|
|
|
- SnapsToDevicePixels="True">
|
|
|
- <ScrollViewer HorizontalScrollBarVisibility="Hidden"
|
|
|
- VerticalScrollBarVisibility="Hidden"
|
|
|
- Name="PART_ContentHost"
|
|
|
- Focusable="False" />
|
|
|
- </Border>
|
|
|
- <ControlTemplate.Triggers>
|
|
|
- <Trigger Property="UIElement.IsEnabled"
|
|
|
- Value="False">
|
|
|
- <Setter Property="UIElement.Opacity"
|
|
|
- TargetName="border"
|
|
|
- Value="0.56" />
|
|
|
- </Trigger>
|
|
|
- <Trigger Property="UIElement.IsMouseOver"
|
|
|
- Value="True">
|
|
|
- <Setter Property="Border.BorderBrush"
|
|
|
- TargetName="border"
|
|
|
- Value="#FF477EDE" />
|
|
|
- <Setter Property="Border.Background" TargetName="border" Value="White" />
|
|
|
- </Trigger>
|
|
|
- <Trigger Property="UIElement.IsFocused" Value="True">
|
|
|
- <Setter Property="Border.Background" TargetName="border" Value="White" />
|
|
|
- <Setter Property="Border.BorderBrush"
|
|
|
- TargetName="border"
|
|
|
- Value="#FF477EDE" />
|
|
|
- </Trigger>
|
|
|
- <Trigger Property="UIElement.IsKeyboardFocused"
|
|
|
- Value="True">
|
|
|
- <Setter Property="Border.BorderBrush"
|
|
|
- TargetName="border"
|
|
|
- Value="#569DE5" />
|
|
|
- </Trigger>
|
|
|
- </ControlTemplate.Triggers>
|
|
|
- </ControlTemplate>
|
|
|
-
|
|
|
<convert:BoolToVisible x:Key="BoolToVisibleConvert" />
|
|
|
</UserControl.Resources>
|
|
|
<Grid>
|
|
@@ -61,45 +23,92 @@
|
|
|
<RowDefinition />
|
|
|
</Grid.RowDefinitions>
|
|
|
<Grid MinWidth="190">
|
|
|
- <TextBlock x:Name="TxtTitle" HorizontalAlignment="Left" Margin="12,0,0,0" Text="Bookmarks" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" />
|
|
|
- <Button Name="BtnSort" HorizontalAlignment="Right" Margin="0,0,0,0" Width="40" Height="40" Content="添加">
|
|
|
- </Button>
|
|
|
+ <TextBlock
|
|
|
+ x:Name="TxtTitle"
|
|
|
+ Margin="12,0,0,0"
|
|
|
+ HorizontalAlignment="Left"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ FontSize="18"
|
|
|
+ FontWeight="SemiBold"
|
|
|
+ Text="Bookmarks" />
|
|
|
+ <Button
|
|
|
+ Name="BtnSort"
|
|
|
+ Width="40"
|
|
|
+ Height="40"
|
|
|
+ Margin="0,0,0,0"
|
|
|
+ HorizontalAlignment="Right"
|
|
|
+ Content="添加" />
|
|
|
</Grid>
|
|
|
<Grid Grid.Row="1">
|
|
|
- <ListView Name="BookMarkListView"
|
|
|
- ItemsSource="{Binding Bookmarklist}"
|
|
|
- BorderThickness="0"
|
|
|
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
- HorizontalContentAlignment="Stretch"
|
|
|
- VirtualizingPanel.IsVirtualizing="True"
|
|
|
- VirtualizingPanel.CacheLengthUnit="Page"
|
|
|
- VirtualizingPanel.CacheLength="1"
|
|
|
- VirtualizingPanel.ScrollUnit="Pixel">
|
|
|
+ <ListView
|
|
|
+ Name="BookMarkListView"
|
|
|
+ HorizontalContentAlignment="Stretch"
|
|
|
+ BorderThickness="0"
|
|
|
+ ItemsSource="{Binding Bookmarklist}"
|
|
|
+ ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
|
+ VirtualizingPanel.CacheLength="1"
|
|
|
+ VirtualizingPanel.CacheLengthUnit="Page"
|
|
|
+ VirtualizingPanel.IsVirtualizing="True"
|
|
|
+ VirtualizingPanel.ScrollUnit="Pixel">
|
|
|
<ListView.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
- <VirtualizingStackPanel Background="White" Margin="-5,0,0,0"></VirtualizingStackPanel>
|
|
|
+ <VirtualizingStackPanel Margin="-5,0,0,0" Background="Transparent" />
|
|
|
</ItemsPanelTemplate>
|
|
|
</ListView.ItemsPanel>
|
|
|
<ListView.ItemTemplate>
|
|
|
- <HierarchicalDataTemplate DataType="{x:Type data:CPDFBookmark}">
|
|
|
- <StackPanel>
|
|
|
- <TextBox Name="TitleInput" Grid.Row="1" Background="Transparent" BorderBrush="Transparent" VerticalAlignment="Top" FontSize="14" Margin="88,0,0,0" Padding="0,0,18,0" BorderThickness="2" Text="{Binding Title}" Visibility="Visible" />
|
|
|
- <TextBlock x:Name="btnClear" Grid.Row="1" HorizontalAlignment="Right" Width="16" Height="16" Margin="0,0,3,0" Visibility="{Binding ElementName=TitleInput, Path=IsFocused, Converter={StaticResource BoolToVisibleConvert}}">
|
|
|
- </TextBlock>
|
|
|
- </StackPanel>
|
|
|
- </HierarchicalDataTemplate>
|
|
|
+ <DataTemplate DataType="{x:Type data:CPDFBookmark}">
|
|
|
+ <Grid Name="ItemGrid">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="26" />
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <TextBox
|
|
|
+ Name="TitleInput"
|
|
|
+ Grid.Row="0"
|
|
|
+ Padding="0,0,18,0"
|
|
|
+ VerticalAlignment="Top"
|
|
|
+ BorderBrush="Transparent"
|
|
|
+ BorderThickness="2"
|
|
|
+ FontSize="14"
|
|
|
+ Text="{Binding Title}"
|
|
|
+ Visibility="Visible" />
|
|
|
+ <TextBlock
|
|
|
+ x:Name="btnClear"
|
|
|
+ Grid.Row="0"
|
|
|
+ Width="16"
|
|
|
+ Height="16"
|
|
|
+ Margin="0,0,3,0"
|
|
|
+ HorizontalAlignment="Right"
|
|
|
+ Visibility="{Binding ElementName=TitleInput, Path=IsFocused, Converter={StaticResource BoolToVisibleConvert}}" />
|
|
|
+ </Grid>
|
|
|
+ </DataTemplate>
|
|
|
</ListView.ItemTemplate>
|
|
|
- <ListView.ItemContainerStyle>
|
|
|
- <Style TargetType="ListViewItem">
|
|
|
- <!--<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListViewItem_PreviewMouseLeftButtonDown" />
|
|
|
- <EventSetter Event="Unselected" Handler="ListViewItem_Unselected" />-->
|
|
|
- </Style>
|
|
|
- </ListView.ItemContainerStyle>
|
|
|
+ <!--<ListView.ItemContainerStyle>
|
|
|
+ <Style TargetType="ListViewItem">
|
|
|
+ -->
|
|
|
+ <!--<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListViewItem_PreviewMouseLeftButtonDown" />
|
|
|
+ <EventSetter Event="Unselected" Handler="ListViewItem_Unselected" />-->
|
|
|
+ <!--
|
|
|
+ </Style>
|
|
|
+ </ListView.ItemContainerStyle>-->
|
|
|
</ListView>
|
|
|
</Grid>
|
|
|
- <StackPanel Name="EmptyPanel" Visibility="{Binding IsEmptyPanelVisibility}" Width="150" VerticalAlignment="Center" Grid.RowSpan="2">
|
|
|
- <Image Width="140" Height="140" Source="\Resources\BOTA\empty_bookmark.png" />
|
|
|
- <TextBlock Name="txtEmpty" Text="No bookmark" Margin="0,12,0,0" TextAlignment="Center" FontFamily="Segoe UI" FontSize="16" />
|
|
|
+ <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>
|