完成稍后再看页面;修复一些问题

croire 3 years ago
parent ed180a0699
commit 6ce7b69a56

@ -1,10 +1,5 @@
using DownKyi.Core.BiliApi.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DownKyi.Core.BiliApi.History.Models
{

@ -170,6 +170,7 @@ namespace DownKyi
containerRegistry.RegisterForNavigation<ViewMySpace>(ViewMySpaceViewModel.Tag);
containerRegistry.RegisterForNavigation<ViewMyFavorites>(ViewMyFavoritesViewModel.Tag);
containerRegistry.RegisterForNavigation<ViewMyBangumiFollow>(ViewMyBangumiFollowViewModel.Tag);
containerRegistry.RegisterForNavigation<ViewMyToViewVideo>(ViewMyToViewVideoViewModel.Tag);
containerRegistry.RegisterForNavigation<ViewMyHistory>(ViewMyHistoryViewModel.Tag);
// downloadManager pages

@ -107,6 +107,7 @@
<Compile Include="ViewModels\PageViewModels\HistoryMedia.cs" />
<Compile Include="ViewModels\PageViewModels\PublicationMedia.cs" />
<Compile Include="ViewModels\PageViewModels\SpaceItem.cs" />
<Compile Include="ViewModels\PageViewModels\ToViewMedia.cs" />
<Compile Include="ViewModels\Settings\DisplayFileNamePart.cs" />
<Compile Include="Models\ParseScopeDisplay.cs" />
<Compile Include="ViewModels\PageViewModels\TabHeader.cs" />
@ -158,6 +159,7 @@
<Compile Include="ViewModels\ViewMyFavoritesViewModel.cs" />
<Compile Include="ViewModels\ViewMyHistoryViewModel.cs" />
<Compile Include="ViewModels\ViewMySpaceViewModel.cs" />
<Compile Include="ViewModels\ViewMyToViewVideoViewModel.cs" />
<Compile Include="ViewModels\ViewPublicationViewModel.cs" />
<Compile Include="ViewModels\ViewPublicFavoritesViewModel.cs" />
<Compile Include="ViewModels\ViewSettingsViewModel.cs" />
@ -234,6 +236,9 @@
<Compile Include="Views\ViewMySpace.xaml.cs">
<DependentUpon>ViewMySpace.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ViewMyToViewVideo.xaml.cs">
<DependentUpon>ViewMyToViewVideo.xaml</DependentUpon>
</Compile>
<Compile Include="Views\ViewPublication.xaml.cs">
<DependentUpon>ViewPublication.xaml</DependentUpon>
</Compile>
@ -428,6 +433,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ViewMyToViewVideo.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ViewPublication.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

@ -88,6 +88,9 @@
<system:String x:Key="HistoryStarted">刚开始</system:String>
<system:String x:Key="HistoryWatch">看到</system:String>
<!-- MyToView -->
<system:String x:Key="MyToView">稍后再看</system:String>
<!-- Publication -->
<system:String x:Key="DownloadSelectedPublication">下载选中项</system:String>
<system:String x:Key="DownloadAllPublication">下载全部</system:String>

@ -154,12 +154,12 @@ namespace DownKyi.ViewModels.PageViewModels
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, tag, Url);
}
// 视频标题点击事件
// UP主头像点击事件
private DelegateCommand<object> upCommand;
public DelegateCommand<object> UpCommand => upCommand ?? (upCommand = new DelegateCommand<object>(ExecuteUpCommand));
/// <summary>
/// 视频标题点击事件
/// UP主头像点击事件
/// </summary>
/// <param name="parameter"></param>
private void ExecuteUpCommand(object parameter)

@ -0,0 +1,107 @@
using DownKyi.Core.BiliApi.BiliUtils;
using DownKyi.Utils;
using Prism.Commands;
using Prism.Events;
using Prism.Mvvm;
using System.Windows.Media.Imaging;
namespace DownKyi.ViewModels.PageViewModels
{
public class ToViewMedia : BindableBase
{
protected readonly IEventAggregator eventAggregator;
public ToViewMedia(IEventAggregator eventAggregator)
{
this.eventAggregator = eventAggregator;
}
// aid
public long Aid { get; set; }
// bvid
public string Bvid { get; set; }
// UP主的mid
public long UpMid { get; set; }
#region 页面属性申明
// 是否选中
private bool isSelected;
public bool IsSelected
{
get => isSelected;
set => SetProperty(ref isSelected, value);
}
// 封面
private BitmapImage cover;
public BitmapImage Cover
{
get => cover;
set => SetProperty(ref cover, value);
}
// 视频标题
private string title;
public string Title
{
get => title;
set => SetProperty(ref title, value);
}
// UP主的昵称
private string upName;
public string UpName
{
get => upName;
set => SetProperty(ref upName, value);
}
// UP主的头像
private BitmapImage upHeader;
public BitmapImage UpHeader
{
get => upHeader;
set => SetProperty(ref upHeader, value);
}
#endregion
#region 命令申明
// 视频标题点击事件
private DelegateCommand<object> titleCommand;
public DelegateCommand<object> TitleCommand => titleCommand ?? (titleCommand = new DelegateCommand<object>(ExecuteTitleCommand));
/// <summary>
/// 视频标题点击事件
/// </summary>
/// <param name="parameter"></param>
private void ExecuteTitleCommand(object parameter)
{
if (!(parameter is string tag)) { return; }
NavigateToView.NavigationView(eventAggregator, ViewVideoDetailViewModel.Tag, tag, $"{ParseEntrance.VideoUrl}{Bvid}");
}
// UP主头像点击事件
private DelegateCommand<object> upCommand;
public DelegateCommand<object> UpCommand => upCommand ?? (upCommand = new DelegateCommand<object>(ExecuteUpCommand));
/// <summary>
/// UP主头像点击事件
/// </summary>
/// <param name="parameter"></param>
private void ExecuteUpCommand(object parameter)
{
if (!(parameter is string tag)) { return; }
NavigateToView.NavigateToViewUserSpace(eventAggregator, tag, UpMid);
}
#endregion
}
}

@ -237,7 +237,7 @@ namespace DownKyi.ViewModels
/// <param name="isOnlySelected"></param>
private async void AddToDownload(bool isOnlySelected)
{
// 收藏夹里只有视频
// 频道里只有视频
AddToDownloadService addToDownloadService = new AddToDownloadService(PlayStreamType.VIDEO);
// 选择文件夹

@ -346,7 +346,7 @@ namespace DownKyi.ViewModels
NavigateToView.NavigationView(eventAggregator, ViewMyBangumiFollowViewModel.Tag, Tag, mid);
break;
case 2:
Console.WriteLine(SelectedPackage);
NavigateToView.NavigationView(eventAggregator, ViewMyToViewVideoViewModel.Tag, Tag, mid);
break;
case 3:
NavigateToView.NavigationView(eventAggregator, ViewMyHistoryViewModel.Tag, Tag, mid);

@ -0,0 +1,400 @@
using DownKyi.Core.BiliApi.History;
using DownKyi.Core.BiliApi.VideoStream;
using DownKyi.Core.Storage;
using DownKyi.CustomControl;
using DownKyi.Events;
using DownKyi.Images;
using DownKyi.Services;
using DownKyi.Services.Download;
using DownKyi.Utils;
using DownKyi.ViewModels.PageViewModels;
using Prism.Commands;
using Prism.Events;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media.Imaging;
namespace DownKyi.ViewModels
{
public class ViewMyToViewVideoViewModel : BaseViewModel
{
public const string Tag = "PageMyToView";
private readonly IDialogService dialogService;
private CancellationTokenSource tokenSource;
#region 页面属性申明
private string pageName = Tag;
public string PageName
{
get => pageName;
set => SetProperty(ref pageName, value);
}
private VectorImage arrowBack;
public VectorImage ArrowBack
{
get => arrowBack;
set => SetProperty(ref arrowBack, value);
}
private Visibility contentVisibility;
public Visibility ContentVisibility
{
get => contentVisibility;
set => SetProperty(ref contentVisibility, value);
}
private ObservableCollection<ToViewMedia> medias;
public ObservableCollection<ToViewMedia> Medias
{
get => medias;
set => SetProperty(ref medias, value);
}
private bool isSelectAll;
public bool IsSelectAll
{
get => isSelectAll;
set => SetProperty(ref isSelectAll, value);
}
private GifImage loading;
public GifImage Loading
{
get => loading;
set => SetProperty(ref loading, value);
}
private Visibility loadingVisibility;
public Visibility LoadingVisibility
{
get => loadingVisibility;
set => SetProperty(ref loadingVisibility, value);
}
private Visibility noDataVisibility;
public Visibility NoDataVisibility
{
get => noDataVisibility;
set => SetProperty(ref noDataVisibility, value);
}
#endregion
public ViewMyToViewVideoViewModel(IEventAggregator eventAggregator, IDialogService dialogService) : base(eventAggregator)
{
this.dialogService = dialogService;
#region 属性初始化
// 初始化loading gif
Loading = new GifImage(Properties.Resources.loading);
Loading.StartAnimate();
LoadingVisibility = Visibility.Collapsed;
NoDataVisibility = Visibility.Collapsed;
ArrowBack = NavigationIcon.Instance().ArrowBack;
ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
Medias = new ObservableCollection<ToViewMedia>();
#endregion
}
#region 命令申明
// 返回事件
private DelegateCommand backSpaceCommand;
public DelegateCommand BackSpaceCommand => backSpaceCommand ?? (backSpaceCommand = new DelegateCommand(ExecuteBackSpace));
/// <summary>
/// 返回事件
/// </summary>
private void ExecuteBackSpace()
{
InitView();
ArrowBack.Fill = DictionaryResource.GetColor("ColorText");
// 结束任务
tokenSource?.Cancel();
NavigationParam parameter = new NavigationParam
{
ViewName = ParentView,
ParentViewName = null,
Parameter = null
};
eventAggregator.GetEvent<NavigationEvent>().Publish(parameter);
}
// 全选按钮点击事件
private DelegateCommand<object> selectAllCommand;
public DelegateCommand<object> SelectAllCommand => selectAllCommand ?? (selectAllCommand = new DelegateCommand<object>(ExecuteSelectAllCommand));
/// <summary>
/// 全选按钮点击事件
/// </summary>
/// <param name="parameter"></param>
private void ExecuteSelectAllCommand(object parameter)
{
if (IsSelectAll)
{
foreach (var item in Medias)
{
item.IsSelected = true;
}
}
else
{
foreach (var item in Medias)
{
item.IsSelected = false;
}
}
}
// 列表选择事件
private DelegateCommand<object> mediasCommand;
public DelegateCommand<object> MediasCommand => mediasCommand ?? (mediasCommand = new DelegateCommand<object>(ExecuteMediasCommand));
/// <summary>
/// 列表选择事件
/// </summary>
/// <param name="parameter"></param>
private void ExecuteMediasCommand(object parameter)
{
if (!(parameter is IList selectedMedia)) { return; }
if (selectedMedia.Count == Medias.Count)
{
IsSelectAll = true;
}
else
{
IsSelectAll = false;
}
}
// 添加选中项到下载列表事件
private DelegateCommand addToDownloadCommand;
public DelegateCommand AddToDownloadCommand => addToDownloadCommand ?? (addToDownloadCommand = new DelegateCommand(ExecuteAddToDownloadCommand));
/// <summary>
/// 添加选中项到下载列表事件
/// </summary>
private void ExecuteAddToDownloadCommand()
{
AddToDownload(true);
}
// 添加所有视频到下载列表事件
private DelegateCommand addAllToDownloadCommand;
public DelegateCommand AddAllToDownloadCommand => addAllToDownloadCommand ?? (addAllToDownloadCommand = new DelegateCommand(ExecuteAddAllToDownloadCommand));
/// <summary>
/// 添加所有视频到下载列表事件
/// </summary>
private void ExecuteAddAllToDownloadCommand()
{
AddToDownload(false);
}
#endregion
/// <summary>
/// 添加到下载
/// </summary>
/// <param name="isOnlySelected"></param>
private async void AddToDownload(bool isOnlySelected)
{
// 稍后再看里只有视频
AddToDownloadService addToDownloadService = new AddToDownloadService(PlayStreamType.VIDEO);
// 选择文件夹
string directory = addToDownloadService.SetDirectory(dialogService);
// 视频计数
int i = 0;
await Task.Run(() =>
{
// 为了避免执行其他操作时,
// Medias变化导致的异常
var list = Medias.ToList();
// 添加到下载
foreach (var media in list)
{
// 只下载选中项,跳过未选中项
if (isOnlySelected && !media.IsSelected) { continue; }
/// 有分P的就下载全部
// 开启服务
VideoInfoService videoInfoService = new VideoInfoService(media.Bvid);
addToDownloadService.SetVideoInfoService(videoInfoService);
addToDownloadService.GetVideo();
addToDownloadService.ParseVideo(videoInfoService);
// 下载
i += addToDownloadService.AddToDownload(eventAggregator, directory);
}
});
if (directory == null)
{
return;
}
// 通知用户添加到下载列表的结果
if (i == 0)
{
eventAggregator.GetEvent<MessageEvent>().Publish(DictionaryResource.GetString("TipAddDownloadingZero"));
}
else
{
eventAggregator.GetEvent<MessageEvent>().Publish($"{DictionaryResource.GetString("TipAddDownloadingFinished1")}{i}{DictionaryResource.GetString("TipAddDownloadingFinished2")}");
}
}
private async void UpdateToViewMediaList()
{
LoadingVisibility = Visibility.Visible;
NoDataVisibility = Visibility.Collapsed;
Medias.Clear();
await Task.Run(() =>
{
CancellationToken cancellationToken = tokenSource.Token;
var toViewList = ToView.GetToView();
if (toViewList == null || toViewList.Count == 0)
{
LoadingVisibility = Visibility.Collapsed;
NoDataVisibility = Visibility.Visible;
return;
}
foreach (var toView in toViewList)
{
// 查询、保存封面
string coverUrl = toView.Pic;
BitmapImage cover;
if (coverUrl == null || coverUrl == "")
{
cover = null;
}
else
{
if (!coverUrl.ToLower().StartsWith("http"))
{
coverUrl = $"https:{toView.Pic}";
}
StorageCover storageCover = new StorageCover();
cover = storageCover.GetCoverThumbnail(toView.Aid, toView.Bvid, toView.Cid, coverUrl, 160, 100);
}
// 获取用户头像
long upMid = -1;
string upName;
BitmapImage upHeader;
if (toView.Owner != null && toView.Owner.Face != null)
{
upMid = toView.Owner.Mid;
upName = toView.Owner.Name;
StorageHeader storageHeader = new StorageHeader();
upHeader = storageHeader.GetHeaderThumbnail(toView.Owner.Mid, upName, toView.Owner.Face, 24, 24);
}
else
{
upName = "";
upHeader = null;
}
App.PropertyChangeAsync(() =>
{
ToViewMedia media = new ToViewMedia(eventAggregator)
{
Aid = toView.Aid,
Bvid = toView.Bvid,
UpMid = upMid,
Cover = cover ?? new BitmapImage(new Uri($"pack://application:,,,/Resources/video-placeholder.png")),
Title = toView.Title,
UpName = upName,
UpHeader = upHeader
};
Medias.Add(media);
ContentVisibility = Visibility.Visible;
LoadingVisibility = Visibility.Collapsed;
NoDataVisibility = Visibility.Collapsed;
});
// 判断是否该结束线程若为true跳出循环
if (cancellationToken.IsCancellationRequested)
{
break;
}
}
}, (tokenSource = new CancellationTokenSource()).Token);
}
/// <summary>
/// 初始化页面数据
/// </summary>
private void InitView()
{
ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
ContentVisibility = Visibility.Collapsed;
LoadingVisibility = Visibility.Collapsed;
NoDataVisibility = Visibility.Collapsed;
Medias.Clear();
IsSelectAll = false;
}
/// <summary>
/// 导航到VideoDetail页面时执行
/// </summary>
/// <param name="navigationContext"></param>
public override void OnNavigatedTo(NavigationContext navigationContext)
{
base.OnNavigatedTo(navigationContext);
ArrowBack.Fill = DictionaryResource.GetColor("ColorTextDark");
// 根据传入参数不同执行不同任务
long mid = navigationContext.Parameters.GetValue<long>("Parameter");
if (mid == 0)
{
IsSelectAll = false;
foreach (var media in Medias)
{
media.IsSelected = false;
}
return;
}
InitView();
UpdateToViewMediaList();
}
}
}

@ -127,8 +127,7 @@
<StackPanel
Name="nameUpper"
Cursor="Hand"
Orientation="Horizontal"
Tag="{Binding UpMid}">
Orientation="Horizontal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding UpCommand}" CommandParameter="{Binding DataContext.PageName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />

@ -0,0 +1,286 @@
<UserControl
x:Class="DownKyi.Views.ViewMyToViewVideo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:custom="clr-namespace:DownKyi.CustomControl"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<UserControl.Resources>
<Style x:Key="MediaListStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid
Name="nameMediaPanel"
Height="100"
Margin="20,15,10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="160" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border
Name="nameCover"
Grid.Column="0"
Width="160"
Height="100"
HorizontalAlignment="Center"
CornerRadius="5">
<Border.Background>
<!-- 长宽比1.6 -->
<ImageBrush ImageSource="{Binding Cover}" />
</Border.Background>
</Border>
<Image
Name="nameChecked"
Grid.Column="0"
Width="24"
Height="24"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Source="/DownKyi;component/Resources/checked.png" />
<StackPanel
Grid.Column="1"
Margin="20,0"
Orientation="Vertical">
<TextBlock
Name="nameTitle"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Cursor="Hand"
FontSize="14"
FontWeight="Bold"
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>
<StackPanel
Name="nameUp"
Margin="0,40,0,0"
Cursor="Hand"
Orientation="Horizontal">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonUp">
<i:InvokeCommandAction Command="{Binding UpCommand}" CommandParameter="{Binding DataContext.PageName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Border
Width="24"
Height="24"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="12">
<Border.Background>
<ImageBrush ImageSource="{Binding UpHeader}" />
</Border.Background>
</Border>
<TextBlock
Name="nameUpName"
Margin="10,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource BrushTextGrey}"
Text="{Binding UpName}" />
</StackPanel>
</StackPanel>
<TextBlock
Grid.Column="1"
Height="1"
Margin="20,0,20,0"
VerticalAlignment="Bottom"
Background="{DynamicResource BrushBorderTranslucent}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="nameChecked" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="nameChecked" Property="Visibility" Value="Hidden" />
</Trigger>
<Trigger SourceName="nameTitle" Property="IsMouseOver" Value="True">
<Setter TargetName="nameTitle" Property="Foreground" Value="{DynamicResource BrushPrimary}" />
</Trigger>
<Trigger SourceName="nameUp" Property="IsMouseOver" Value="True">
<Setter TargetName="nameUpName" Property="Foreground" Value="{DynamicResource BrushPrimary}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<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}"
Text="{DynamicResource MyToView}" />
</StackPanel>
</Button>
</Grid>
<TextBlock Grid.Row="1" Background="{DynamicResource BrushBorder}" />
<Grid Grid.Row="2" Visibility="{Binding ContentVisibility}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="1" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<ListBox
x:Name="nameMedias"
Grid.Row="0"
BorderThickness="0"
ItemContainerStyle="{StaticResource MediaListStyle}"
ItemsSource="{Binding Medias}"
ScrollViewer.CanContentScroll="False"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode="Extended">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding MediasCommand}" CommandParameter="{Binding ElementName=nameMedias, Path=SelectedItems}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Style>
<Style TargetType="{x:Type ListBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border
x:Name="Bd"
Padding="0"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer Focusable="False">
<ItemsPresenter />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
</ListBox>
<TextBlock Grid.Row="1" Background="{DynamicResource BrushBorder}" />
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
<ColumnDefinition />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="80" />
</Grid.ColumnDefinitions>
<CheckBox
Grid.Column="0"
Margin="10,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding SelectAllCommand}"
CommandParameter="{Binding ElementName=nameMedias, Path=SelectedItem}"
Content="{DynamicResource SelectAll}"
Foreground="{DynamicResource BrushTextDark}"
IsChecked="{Binding IsSelectAll, Mode=TwoWay}"
Style="{StaticResource CheckBoxStyle}" />
<Button
Grid.Column="2"
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Command="{Binding AddToDownloadCommand}"
Content="{DynamicResource DownloadSelectedPublication}"
FontSize="12"
Foreground="{DynamicResource BrushText}"
Style="{StaticResource BtnStyle}" />
<Button
Grid.Column="3"
Margin="0,0,10,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Command="{Binding AddAllToDownloadCommand}"
Content="{DynamicResource DownloadAllPublication}"
FontSize="12"
Foreground="{DynamicResource BrushText}"
Style="{StaticResource BtnStyle}" />
</Grid>
</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>

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DownKyi.Views
{
/// <summary>
/// ViewMyToView.xaml 的交互逻辑
/// </summary>
public partial class ViewMyToViewVideo : UserControl
{
public ViewMyToViewVideo()
{
InitializeComponent();
}
}
}
Loading…
Cancel
Save