You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
downkyi/DownKyi/Views/ViewPublicFavorites.xaml

533 lines
27 KiB

<UserControl
x:Class="DownKyi.Views.ViewPublicFavorites"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="1" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="0"
Margin="10,5,0,5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding BackSpaceCommand}"
Style="{StaticResource ImageBtnStyle}">
<StackPanel Orientation="Horizontal">
<ContentControl Width="24" Height="24">
<Path
Width="{Binding ArrowBack.Width}"
Height="{Binding ArrowBack.Height}"
Data="{Binding ArrowBack.Data}"
Fill="{Binding ArrowBack.Fill}"
Stretch="None" />
</ContentControl>
<TextBlock
VerticalAlignment="Center"
FontSize="16"
Foreground="{DynamicResource BrushTextDark}"
3 years ago
Text="{DynamicResource PublicFavorites}" />
</StackPanel>
</Button>
<Button
Grid.Column="2"
Width="24"
Height="24"
Margin="10,5"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Command="{Binding DownloadManagerCommand}"
Style="{StaticResource ImageBtnStyle}"
ToolTip="{DynamicResource DownloadManager}">
<ContentControl>
<Path
Width="{Binding DownloadManage.Width}"
Height="{Binding DownloadManage.Height}"
Data="{Binding DownloadManage.Data}"
Fill="{Binding DownloadManage.Fill}"
Stretch="Uniform" />
</ContentControl>
</Button>
</Grid>
<TextBlock Grid.Row="1" Background="{DynamicResource BrushBorder}" />
<Grid Grid.Row="2" Visibility="{Binding ContentVisibility}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="320" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<!-- 左侧 -->
<StackPanel
Grid.Column="0"
Margin="10,10,10,10"
Orientation="Vertical">
<Image Source="{Binding Favorites.Cover}">
<Image.ContextMenu>
<ContextMenu>
<MenuItem Command="{Binding CopyCoverCommand}" Header="{DynamicResource CopyCover}" />
<MenuItem Command="{Binding CopyCoverUrlCommand}" Header="{DynamicResource CopyCoverUrl}" />
<!-- TODO 复制封面到文件 -->
</ContextMenu>
</Image.ContextMenu>
</Image>
<TextBlock
Margin="0,10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="18"
FontWeight="Bold"
Foreground="{DynamicResource BrushTextDark}"
Text="{Binding Favorites.Title}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding Favorites.Title}" />
<ScrollViewer
MaxHeight="80"
Margin="0,10,0,0"
VerticalScrollBarVisibility="Auto">
<TextBox
Background="{x:Null}"
BorderBrush="{x:Null}"
BorderThickness="0"
FontSize="12"
Foreground="{DynamicResource BrushTextDark}"
IsReadOnly="True"
Text="{Binding Favorites.Description}"
TextWrapping="WrapWithOverflow" />
</ScrollViewer>
<Grid Margin="0,15,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
HorizontalAlignment="Left"
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{Binding Favorites.CreateTime}" />
<StackPanel
Grid.Column="1"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{Binding Favorites.MediaCount}" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{DynamicResource FavoritesMediaCount}" />
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Style.Triggers>
<DataTrigger Binding="{Binding Favorites.MediaCount}" Value="0">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding Favorites.MediaCount}" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
</StackPanel>
</Grid>
<Grid Margin="0,15,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel
Grid.Column="0"
HorizontalAlignment="Center"
Orientation="Vertical">
<ContentControl Width="16" Height="16">
<Path
Width="{Binding Favorites.Play.Width}"
Height="{Binding Favorites.Play.Height}"
Data="{Binding Favorites.Play.Data}"
Fill="{Binding Favorites.Play.Fill}"
Stretch="UniformToFill" />
</ContentControl>
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextGrey2}"
Text="{Binding Favorites.PlayNumber}" />
</StackPanel>
<StackPanel
Grid.Column="1"
HorizontalAlignment="Center"
Orientation="Vertical">
<ContentControl Width="16" Height="16">
<Path
Width="{Binding Favorites.Like.Width}"
Height="{Binding Favorites.Like.Height}"
Data="{Binding Favorites.Like.Data}"
Fill="{Binding Favorites.Like.Fill}"
Stretch="UniformToFill" />
</ContentControl>
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextGrey2}"
Text="{Binding Favorites.LikeNumber}" />
</StackPanel>
<StackPanel
Grid.Column="2"
HorizontalAlignment="Center"
Orientation="Vertical">
<ContentControl Width="16" Height="16">
<Path
Width="{Binding Favorites.Favorite.Width}"
Height="{Binding Favorites.Favorite.Height}"
Data="{Binding Favorites.Favorite.Data}"
Fill="{Binding Favorites.Favorite.Fill}"
Stretch="UniformToFill" />
</ContentControl>
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextGrey2}"
Text="{Binding Favorites.FavoriteNumber}" />
</StackPanel>
<StackPanel
Grid.Column="3"
HorizontalAlignment="Center"
Orientation="Vertical">
<ContentControl Width="16" Height="16">
<Path
Width="{Binding Favorites.Share.Width}"
Height="{Binding Favorites.Share.Height}"
Data="{Binding Favorites.Share.Data}"
Fill="{Binding Favorites.Share.Fill}"
Stretch="UniformToFill" />
</ContentControl>
<TextBlock
Margin="0,5,0,0"
HorizontalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource BrushTextGrey2}"
Text="{Binding Favorites.ShareNumber}" />
</StackPanel>
</Grid>
<StackPanel
Margin="0,20,0,0"
Cursor="Hand"
Orientation="Horizontal"
ToolTip="{Binding Favorites.UpName}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding UpperCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Image
Width="48"
Height="48"
Source="{Binding Favorites.UpHeader}">
<Image.Clip>
<EllipseGeometry
Center="24,24"
RadiusX="24"
RadiusY="24" />
</Image.Clip>
</Image>
<TextBlock
Margin="15,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource BrushPrimary}"
Text="{Binding Favorites.UpName}"
TextTrimming="CharacterEllipsis" />
</StackPanel>
<TextBlock
Height="1"
Margin="0,20,0,0"
Background="{DynamicResource BrushBorder}" />
<Button
Height="40"
Margin="0,20,0,0"
HorizontalAlignment="Stretch"
Command="{Binding AddToDownloadCommand}"
Content="{DynamicResource DownloadSelected}"
FontSize="12"
Foreground="{DynamicResource BrushText}"
Style="{StaticResource BtnStyle}" />
<Button
Height="40"
Margin="0,20,0,0"
HorizontalAlignment="Stretch"
Command="{Binding AddAllToDownloadCommand}"
Content="{DynamicResource AddAllToDownload}"
FontSize="12"
Foreground="{DynamicResource BrushText}"
Style="{StaticResource BtnStyle}" />
</StackPanel>
<!-- 右侧内容区 -->
<ListBox
x:Name="nameFavoritesMedias"
Grid.Column="1"
Margin="30,0,0,0"
ItemsSource="{Binding FavoritesMedias, Mode=TwoWay}"
SelectionMode="Extended">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding FavoritesMediasCommand}" CommandParameter="{Binding ElementName=nameFavoritesMedias, Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.Template>
<ControlTemplate TargetType="{x:Type ListBox}">
<ScrollViewer
CanContentScroll="False"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<StackPanel IsItemsHost="True" Orientation="Vertical" />
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid Margin="0,10" Background="{DynamicResource BrushBackground}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
Width="35"
Margin="0,0,5,0"
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource BrushTextDark}"
Text="{Binding Order}" />
<Image Grid.Column="1" Source="{Binding Cover}" />
<Border
x:Name="nameInfoPanel"
Grid.Column="1"
Width="150"
Height="95"
Background="{DynamicResource BrushMask}"
Visibility="Hidden">
<TextBlock
Margin="5,0,0,5"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
FontSize="12"
Foreground="{DynamicResource BrushText}"
Text="{Binding Duration}" />
</Border>
<Image
x:Name="nameIsSelected"
Grid.Column="1"
Width="24"
Height="24"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Source="/DownKyi;component/Resources/checked.png" />
<Grid Grid.Column="2" Margin="20,0">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Cursor="Hand"
FontSize="14"
Text="{Binding Title}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding Title}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding TitleCommand}" CommandParameter="{Binding DataContext.PageName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource BrushTextDark}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource BrushPrimary}" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{Binding PlayNumber}" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{DynamicResource Play}" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text=" · " />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{Binding DanmakuNumber}" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{DynamicResource Danmaku}" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text=" · " />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{Binding FavoriteNumber}" />
<TextBlock
FontSize="12"
Foreground="{DynamicResource BrushTextGrey}"
Text="{DynamicResource Favorite}" />
</StackPanel>
<TextBlock
Grid.Row="2"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Cursor="Hand"
FontSize="12"
Text="{Binding UpName, StringFormat={}UP: {0}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding VideoUpperCommand}" CommandParameter="{Binding DataContext.PageName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource BrushTextGrey}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource BrushPrimary}" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="nameInfoPanel" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="nameIsSelected" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="nameIsSelected" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
<!-- 加载gif -->
<StackPanel
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Vertical"
Visibility="{Binding MediaLoadingVisibility}">
<ContentControl
Width="40"
Height="40"
Content="{Binding MediaLoading}" />
</StackPanel>
</Grid>
<!-- 加载gif -->
<StackPanel
Grid.Row="2"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Vertical"
Visibility="{Binding LoadingVisibility}">
<ContentControl
Width="40"
Height="40"
Content="{Binding Loading}" />
<TextBlock
Margin="0,10,0,0"
FontSize="14"
Foreground="{DynamicResource BrushTextDark}"
Text="{DynamicResource PublicationWait}" />
</StackPanel>
<!-- 没有数据提示 -->
<Image
Grid.Row="2"
Width="256"
Height="256"
Source="/DownKyi;component/Resources/no-data.png"
Visibility="{Binding NoDataVisibility}" />
</Grid>
</UserControl>