完成下载中和下载完成列表的UI

croire 3 years ago
parent a95070ffae
commit ba1235669c

@ -65,7 +65,7 @@ namespace DownKyi.Core.Aria2cNet.Server
try try
{ {
var stream = File.Open(logFile, FileMode.Open); var stream = File.Open(logFile, FileMode.Open);
if (stream.Length >= 512 * 1024 * 1024L) if (stream.Length >= 10 * 1024 * 1024L)
{ {
stream.SetLength(0); stream.SetLength(0);
} }

@ -204,7 +204,7 @@ namespace DownKyi.Core.Danmaku2Ass
{ {
public TopDisplay(Config config, Danmaku danmaku) : base(config, danmaku) public TopDisplay(Config config, Danmaku danmaku) : base(config, danmaku)
{ {
Console.WriteLine("TopDisplay constructor."); //Console.WriteLine("TopDisplay constructor.");
} }
/// <summary> /// <summary>
@ -226,7 +226,7 @@ namespace DownKyi.Core.Danmaku2Ass
{ {
public BottomDisplay(Config config, Danmaku danmaku) : base(config, danmaku) public BottomDisplay(Config config, Danmaku danmaku) : base(config, danmaku)
{ {
Console.WriteLine("BottomDisplay constructor."); //Console.WriteLine("BottomDisplay constructor.");
} }
/// <summary> /// <summary>
@ -253,7 +253,7 @@ namespace DownKyi.Core.Danmaku2Ass
public ScrollDisplay(Config config, Danmaku danmaku) : base() public ScrollDisplay(Config config, Danmaku danmaku) : base()
{ {
Console.WriteLine("ScrollDisplay constructor."); //Console.WriteLine("ScrollDisplay constructor.");
Config = config; Config = config;
Danmaku = danmaku; Danmaku = danmaku;

@ -49,16 +49,16 @@ namespace DownKyi.Core.Danmaku2Ass
public void ApplyFilter() public void ApplyFilter()
{ {
Dictionary<string, int> filterDetail = new Dictionary<string, int>() { Dictionary<string, int> filterDetail = new Dictionary<string, int>() {
{ "top_filter",0}, { "top_filter", 0},
{ "bottom_filter",0}, { "bottom_filter", 0},
{ "scroll_filter",0}, { "scroll_filter", 0},
//{ "custom_filter",0} //{ "custom_filter",0}
}; };
List<Danmaku> danmakus = Danmakus; List<Danmaku> danmakus = Danmakus;
//string[] orders = { "top_filter", "bottom_filter", "scroll_filter", "custom_filter" }; //string[] orders = { "top_filter", "bottom_filter", "scroll_filter", "custom_filter" };
string[] orders = { "top_filter", "bottom_filter", "scroll_filter" }; string[] orders = { "top_filter", "bottom_filter", "scroll_filter" };
foreach (var name in orders) foreach (string name in orders)
{ {
Filter filter; Filter filter;
try try

@ -69,6 +69,17 @@
Fill = "#FF000000" Fill = "#FF000000"
}; };
Trash = new VectorImage
{
Height = 20,
Width = 20,
Data = @"M683 85 q0 -27 -20.5 -55 q-20.5 -28 -65.5 -30 l-170 0 q-39 1 -62 23.5 q-23 22.5 -24 61.5 l-341 0 l0 86 l1024 0 l0 -86
l-341 0 ZM341 256 l86 0 l0 597 l-86 0 l0 -597 ZM597 256 l86 0 l0 597 l-86 0 l0 -597 ZM853 853 q0 39 -23 62
q-23 23 -62 24 l-512 0 q-39 -1 -62 -24 q-23 -23 -23 -62 l0 -597 l-86 0 l0 597 q2 73 50.5 121 q48.5 48 120.5 50 l512 0
q72 -2 120.5 -50 q48.5 -48 50.5 -121 l0 -597 l-86 0 l0 597 Z",
Fill = "#FF000000"
};
Delete = new VectorImage Delete = new VectorImage
{ {
Height = 18, Height = 18,
@ -103,6 +114,30 @@
Fill = "#FF000000" Fill = "#FF000000"
}; };
Retry = new VectorImage
{
Height = 20,
Width = 20,
Data = @"M536.69 128.65 q-161.14 5.2 -270.3 113.71 q-109.15 108.5 -113.05 269.64 q3.9 161.14 113.05 269.64
q109.16 108.5 270.3 113.71 q101.36 -1.3 185.82 -47.43 q84.47 -46.13 140.35 -129.3 q6.5 -14.3 22.09 -24.7
q15.6 -10.39 31.19 -10.39 q28.59 0 47.44 18.85 q18.84 18.85 20.14 48.74 q0 11.69 -5.2 20.79 q0 3.9 0 7.8 l-3.9 5.19
q-72.77 111.76 -185.82 174.78 q-113.06 63.03 -246.91 64.33 q-102.66 0 -196.22 -38.34 q-93.57 -38.33 -166.34 -111.11
q-72.77 -72.77 -111.1 -166.34 q-38.33 -93.56 -38.33 -196.22 q0 -102.66 38.33 -196.23 q38.34 -93.56 111.1 -166.33
q72.77 -72.77 166.34 -111.1 q93.56 -38.34 196.22 -38.34 q92.26 0 176.73 31.19 q84.47 31.19 152.04 89.66 l0 -25.99
q1.3 -27.29 18.2 -44.83 q16.89 -17.54 42.88 -17.54 q25.99 0 44.18 18.19 q18.19 18.19 18.19 44.18 l0 189.73
q0 24.69 -18.19 42.88 q-18.19 18.19 -42.88 18.19 l-191.03 0 q-24.69 0 -42.88 -18.19 q-18.2 -18.19 -18.2 -42.88
q0 -28.59 16.25 -47.43 q16.25 -18.84 44.84 -20.13 l37.69 0 q-51.98 -42.89 -114.36 -65.63 q-62.38 -22.74 -128.65 -22.74 Z",
Fill = "#FF000000"
};
Folder = new VectorImage
{
Height = 16,
Width = 20,
Data = @"M18,2H10L8,0H2A2,2,0,0,0,0,2V14a2,2,0,0,0,2,2H18a2,2,0,0,0,2-2V4A2,2,0,0,0,18,2Zm0,12H2V4H18Z",
Fill = "#FF000000"
};
} }
public VectorImage GeneralSearch { get; private set; } public VectorImage GeneralSearch { get; private set; }
@ -110,9 +145,12 @@
public VectorImage DownloadManage { get; private set; } public VectorImage DownloadManage { get; private set; }
public VectorImage Toolbox { get; private set; } public VectorImage Toolbox { get; private set; }
public VectorImage Trash { get; private set; }
public VectorImage Delete { get; private set; } public VectorImage Delete { get; private set; }
public VectorImage Start { get; private set; } public VectorImage Start { get; private set; }
public VectorImage Pause { get; private set; } public VectorImage Pause { get; private set; }
public VectorImage Retry { get; private set; }
public VectorImage Folder { get; private set; }
} }
} }

@ -116,6 +116,13 @@
<system:String x:Key="DownloadedSortByOrder">按序号排序</system:String> <system:String x:Key="DownloadedSortByOrder">按序号排序</system:String>
<system:String x:Key="ClearAllDownloaded">清空所有记录</system:String> <system:String x:Key="ClearAllDownloaded">清空所有记录</system:String>
<system:String x:Key="StartDownload">开始</system:String>
<system:String x:Key="PauseDownload">暂停</system:String>
<system:String x:Key="RetryDownload">重试</system:String>
<system:String x:Key="DeleteDownload">移除</system:String>
<system:String x:Key="OpenFolder">打开文件夹</system:String>
<system:String x:Key="OpenVideo">播放</system:String>
<!-- Settings --> <!-- Settings -->
<system:String x:Key="PressEnterToApplySettingTip">按回车键应用设置</system:String> <system:String x:Key="PressEnterToApplySettingTip">按回车键应用设置</system:String>

@ -11,6 +11,7 @@ using DownKyi.Core.Logging;
using DownKyi.Core.Settings; using DownKyi.Core.Settings;
using DownKyi.Core.Storage; using DownKyi.Core.Storage;
using DownKyi.Core.Utils; using DownKyi.Core.Utils;
using DownKyi.Images;
using DownKyi.Models; using DownKyi.Models;
using DownKyi.Utils; using DownKyi.Utils;
using DownKyi.ViewModels.DownloadManager; using DownKyi.ViewModels.DownloadManager;
@ -145,7 +146,6 @@ namespace DownKyi.Services.Download
case DownloadResult.SUCCESS: case DownloadResult.SUCCESS:
return Path.Combine(path, fileName); return Path.Combine(path, fileName);
case DownloadResult.FAILED: case DownloadResult.FAILED:
return null;
case DownloadResult.ABORT: case DownloadResult.ABORT:
return null; return null;
default: default:
@ -395,6 +395,8 @@ namespace DownKyi.Services.Download
foreach (DownloadingItem item in downloadingList) foreach (DownloadingItem item in downloadingList)
{ {
item.Downloading.DownloadStatus = DownloadStatus.WAIT_FOR_DOWNLOAD; item.Downloading.DownloadStatus = DownloadStatus.WAIT_FOR_DOWNLOAD;
item.Progress = 0;
downloadStorageService.UpdateDownloading(item); downloadStorageService.UpdateDownloading(item);
} }
foreach (DownloadedItem item in downloadedList) foreach (DownloadedItem item in downloadedList)
@ -494,6 +496,12 @@ namespace DownKyi.Services.Download
// 暂停 // 暂停
Pause(downloading); Pause(downloading);
// 是否存在
var isExist = IsExist(downloading);
if (!isExist.Result)
{
return;
}
// 设置下载状态 // 设置下载状态
downloading.Downloading.DownloadStatus = DownloadStatus.DOWNLOADING; downloading.Downloading.DownloadStatus = DownloadStatus.DOWNLOADING;
@ -507,6 +515,12 @@ namespace DownKyi.Services.Download
// 暂停 // 暂停
Pause(downloading); Pause(downloading);
// 是否存在
isExist = IsExist(downloading);
if (!isExist.Result)
{
return;
}
string videoUid = null; string videoUid = null;
// 如果需要下载视频 // 如果需要下载视频
@ -517,6 +531,12 @@ namespace DownKyi.Services.Download
// 暂停 // 暂停
Pause(downloading); Pause(downloading);
// 是否存在
isExist = IsExist(downloading);
if (!isExist.Result)
{
return;
}
string outputDanmaku = null; string outputDanmaku = null;
// 如果需要下载弹幕 // 如果需要下载弹幕
@ -527,6 +547,12 @@ namespace DownKyi.Services.Download
// 暂停 // 暂停
Pause(downloading); Pause(downloading);
// 是否存在
isExist = IsExist(downloading);
if (!isExist.Result)
{
return;
}
List<string> outputSubtitles = null; List<string> outputSubtitles = null;
// 如果需要下载字幕 // 如果需要下载字幕
@ -537,6 +563,12 @@ namespace DownKyi.Services.Download
// 暂停 // 暂停
Pause(downloading); Pause(downloading);
// 是否存在
isExist = IsExist(downloading);
if (!isExist.Result)
{
return;
}
string outputCover = null; string outputCover = null;
// 如果需要下载封面 // 如果需要下载封面
@ -552,6 +584,12 @@ namespace DownKyi.Services.Download
// 暂停 // 暂停
Pause(downloading); Pause(downloading);
// 是否存在
isExist = IsExist(downloading);
if (!isExist.Result)
{
return;
}
// 混流 // 混流
string outputMedia = string.Empty; string outputMedia = string.Empty;
@ -561,9 +599,16 @@ namespace DownKyi.Services.Download
} }
// 暂停 // 暂停
Pause(downloading); //Pause(downloading);
// 是否存在
isExist = IsExist(downloading);
if (!isExist.Result)
{
return;
}
// 检测音频、视频是否下载成功 // 检测音频、视频是否下载成功
bool isMediaSuccess = true;
if (downloading.DownloadBase.NeedDownloadContent["downloadAudio"] || downloading.DownloadBase.NeedDownloadContent["downloadVideo"]) if (downloading.DownloadBase.NeedDownloadContent["downloadAudio"] || downloading.DownloadBase.NeedDownloadContent["downloadVideo"])
{ {
// 只有下载音频不下载视频时才输出aac // 只有下载音频不下载视频时才输出aac
@ -571,16 +616,31 @@ namespace DownKyi.Services.Download
if (File.Exists(outputMedia)) if (File.Exists(outputMedia))
{ {
// 成功 // 成功
isMediaSuccess = true;
}
else
{
isMediaSuccess = false;
} }
} }
// 检测弹幕是否下载成功 // 检测弹幕是否下载成功
if (downloading.DownloadBase.NeedDownloadContent["downloadDanmaku"] && File.Exists(outputDanmaku)) bool isDanmakuSuccess = true;
if (downloading.DownloadBase.NeedDownloadContent["downloadDanmaku"])
{ {
// 成功 if (File.Exists(outputDanmaku))
{
// 成功
isDanmakuSuccess = true;
}
else
{
isDanmakuSuccess = false;
}
} }
// 检测字幕是否下载成功 // 检测字幕是否下载成功
bool isSubtitleSuccess = true;
if (downloading.DownloadBase.NeedDownloadContent["downloadSubtitle"]) if (downloading.DownloadBase.NeedDownloadContent["downloadSubtitle"])
{ {
if (outputSubtitles == null) if (outputSubtitles == null)
@ -591,25 +651,39 @@ namespace DownKyi.Services.Download
{ {
foreach (string subtitle in outputSubtitles) foreach (string subtitle in outputSubtitles)
{ {
if (File.Exists(subtitle)) if (!File.Exists(subtitle))
{ {
// 成功 // 如果有一个不存在则失败
isSubtitleSuccess = false;
} }
} }
} }
} }
// 检测封面是否下载成功 // 检测封面是否下载成功
if (downloading.DownloadBase.NeedDownloadContent["downloadCover"] && File.Exists(outputCover)) bool isCover = true;
if (downloading.DownloadBase.NeedDownloadContent["downloadCover"])
{ {
// 成功 if (File.Exists(outputCover))
{
// 成功
isCover = true;
}
else
{
isCover = false;
}
}
if (!isMediaSuccess || !isDanmakuSuccess || !isSubtitleSuccess || !isCover)
{
downloading.Downloading.DownloadStatus = DownloadStatus.DOWNLOAD_FAILED;
downloading.StartOrPause = ButtonIcon.Instance().Retry;
downloading.StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
return;
} }
// TODO // 下载完成后处理
// 将下载结果写入数据库
// 包括下载请求的DownloadingItem对象
// 下载结果是否成功等
// 对是否成功的判断只要outputMedia存在则成功否则失败
Downloaded downloaded = new Downloaded Downloaded downloaded = new Downloaded
{ {
@ -690,6 +764,34 @@ namespace DownKyi.Services.Download
downloading.DownloadStatusTitle = oldStatus; downloading.DownloadStatusTitle = oldStatus;
} }
/// <summary>
/// 是否存在于下载列表中
/// </summary>
/// <param name="downloading"></param>
/// <returns></returns>
private async Task<bool> IsExist(DownloadingItem downloading)
{
bool isExist = downloadingList.Contains(downloading);
if (isExist)
{
return true;
}
else
{
// 先恢复为waiting状态暂停状态下Remove会导致文件重新下载原因暂不清楚
await AriaClient.UnpauseAsync(downloading.Downloading.Gid);
// 移除下载项
var ariaRemove = await AriaClient.RemoveAsync(downloading.Downloading.Gid);
if (ariaRemove == null || ariaRemove.Result == downloading.Downloading.Gid)
{
// 从内存中删除下载项
await AriaClient.RemoveDownloadResultAsync(downloading.Downloading.Gid);
}
return false;
}
}
/// <summary> /// <summary>
/// 启动Aria服务器 /// 启动Aria服务器
/// </summary> /// </summary>
@ -724,13 +826,6 @@ namespace DownKyi.Services.Download
var task = await AriaServer.StartServerAsync(config); var task = await AriaServer.StartServerAsync(config);
if (task) { Console.WriteLine("Start ServerAsync Completed"); } if (task) { Console.WriteLine("Start ServerAsync Completed"); }
Console.WriteLine("Start ServerAsync end"); Console.WriteLine("Start ServerAsync end");
// 恢复所有下载
//var ariaPause = await AriaClient.UnpauseAllAsync();
//if (ariaPause != null)
//{
// Core.Utils.Debugging.Console.PrintLine(ariaPause.ToString());
//}
} }
/// <summary> /// <summary>

@ -14,6 +14,8 @@
<SolidColorBrush x:Key="BrushCloseBtnHover" Color="{DynamicResource ColorCloseBtnHover}" /> <SolidColorBrush x:Key="BrushCloseBtnHover" Color="{DynamicResource ColorCloseBtnHover}" />
<SolidColorBrush x:Key="BrushCloseBtnPressed" Color="{DynamicResource ColorCloseBtnPressed}" /> <SolidColorBrush x:Key="BrushCloseBtnPressed" Color="{DynamicResource ColorCloseBtnPressed}" />
<SolidColorBrush x:Key="BrushWarning" Color="{DynamicResource ColorWarning}" />
<SolidColorBrush x:Key="BrushPrimary" Color="{DynamicResource ColorPrimary}" /> <SolidColorBrush x:Key="BrushPrimary" Color="{DynamicResource ColorPrimary}" />
<SolidColorBrush x:Key="BrushPrimaryTranslucent" Color="{DynamicResource ColorPrimaryTranslucent}" /> <SolidColorBrush x:Key="BrushPrimaryTranslucent" Color="{DynamicResource ColorPrimaryTranslucent}" />
<SolidColorBrush x:Key="BrushPrimaryTranslucent2" Color="{DynamicResource ColorPrimaryTranslucent2}" /> <SolidColorBrush x:Key="BrushPrimaryTranslucent2" Color="{DynamicResource ColorPrimaryTranslucent2}" />

@ -14,6 +14,8 @@
<Color x:Key="ColorCloseBtnHover">#FFE81123</Color> <Color x:Key="ColorCloseBtnHover">#FFE81123</Color>
<Color x:Key="ColorCloseBtnPressed">#FFF1707A</Color> <Color x:Key="ColorCloseBtnPressed">#FFF1707A</Color>
<Color x:Key="ColorWarning">#FFFF4D3C</Color>
<Color x:Key="ColorPrimary">#FF00A1D6</Color> <Color x:Key="ColorPrimary">#FF00A1D6</Color>
<Color x:Key="ColorPrimaryTranslucent">#C800A1D6</Color> <Color x:Key="ColorPrimaryTranslucent">#C800A1D6</Color>
<Color x:Key="ColorPrimaryTranslucent2">#7F00A1D6</Color> <Color x:Key="ColorPrimaryTranslucent2">#7F00A1D6</Color>

@ -1,5 +1,6 @@
using DownKyi.Images; using DownKyi.Images;
using DownKyi.Models; using DownKyi.Models;
using DownKyi.Utils;
using Prism.Commands; using Prism.Commands;
using System.IO; using System.IO;
@ -9,6 +10,17 @@ namespace DownKyi.ViewModels.DownloadManager
{ {
public DownloadedItem() : base() public DownloadedItem() : base()
{ {
// 打开文件夹按钮
OpenFolder = ButtonIcon.Instance().Folder;
OpenFolder.Fill = DictionaryResource.GetColor("ColorPrimary");
// 打开视频按钮
OpenVideo = ButtonIcon.Instance().Start;
OpenVideo.Fill = DictionaryResource.GetColor("ColorPrimary");
// 删除按钮
RemoveVideo = ButtonIcon.Instance().Trash;
RemoveVideo.Fill = DictionaryResource.GetColor("ColorWarning");
} }
// model数据 // model数据
@ -73,9 +85,10 @@ namespace DownKyi.ViewModels.DownloadManager
private void ExecuteOpenFolderCommand() private void ExecuteOpenFolderCommand()
{ {
string videoPath = $"{DownloadBase.FilePath}.mp4"; string videoPath = $"{DownloadBase.FilePath}.mp4";
if (File.Exists(videoPath)) FileInfo fileInfo = new FileInfo(videoPath);
if (File.Exists(fileInfo.FullName))
{ {
System.Diagnostics.Process.Start("Explorer", "/select," + videoPath); System.Diagnostics.Process.Start("Explorer", "/select," + fileInfo.FullName);
} }
else else
{ {
@ -93,9 +106,10 @@ namespace DownKyi.ViewModels.DownloadManager
private void ExecuteOpenVideoCommand() private void ExecuteOpenVideoCommand()
{ {
string videoPath = $"{DownloadBase.FilePath}.mp4"; string videoPath = $"{DownloadBase.FilePath}.mp4";
if (File.Exists(videoPath)) var fileInfo = new FileInfo(videoPath);
if (File.Exists(fileInfo.FullName))
{ {
System.Diagnostics.Process.Start(videoPath); System.Diagnostics.Process.Start(fileInfo.FullName);
} }
else else
{ {

@ -80,6 +80,13 @@ namespace DownKyi.ViewModels.DownloadManager
} }
} }
// 操作提示
private string operationTip;
public string OperationTip
{
get => operationTip;
set => SetProperty(ref operationTip, value);
}
#region 控制按钮 #region 控制按钮
@ -87,7 +94,14 @@ namespace DownKyi.ViewModels.DownloadManager
public VectorImage StartOrPause public VectorImage StartOrPause
{ {
get => startOrPause; get => startOrPause;
set => SetProperty(ref startOrPause, value); set
{
SetProperty(ref startOrPause, value);
OperationTip = value.Equals(ButtonIcon.Instance().Start) ? DictionaryResource.GetString("StartDownload")
: value.Equals(ButtonIcon.Instance().Pause) ? DictionaryResource.GetString("PauseDownload")
: value.Equals(ButtonIcon.Instance().Retry) ? DictionaryResource.GetString("RetryDownload") : null;
}
} }
private VectorImage delete; private VectorImage delete;

@ -48,6 +48,9 @@ namespace DownKyi.ViewModels.DownloadManager
case 2: case 2:
App.SortDownloadedList(DownloadFinishedSort.NUMBER); App.SortDownloadedList(DownloadFinishedSort.NUMBER);
break; break;
default:
App.SortDownloadedList(DownloadFinishedSort.DOWNLOAD);
break;
} }
} }
@ -60,6 +63,7 @@ namespace DownKyi.ViewModels.DownloadManager
/// </summary> /// </summary>
private void ExecuteClearAllDownloadedCommand() private void ExecuteClearAllDownloadedCommand()
{ {
DownloadedList.Clear();
} }
#endregion #endregion

@ -46,6 +46,8 @@ namespace DownKyi.ViewModels.DownloadManager
case DownloadStatus.NOT_STARTED: case DownloadStatus.NOT_STARTED:
case DownloadStatus.WAIT_FOR_DOWNLOAD: case DownloadStatus.WAIT_FOR_DOWNLOAD:
downloading.Downloading.DownloadStatus = DownloadStatus.PAUSE_STARTED; downloading.Downloading.DownloadStatus = DownloadStatus.PAUSE_STARTED;
downloading.StartOrPause = ButtonIcon.Instance().Start;
downloading.StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
break; break;
case DownloadStatus.PAUSE_STARTED: case DownloadStatus.PAUSE_STARTED:
break; break;
@ -53,6 +55,8 @@ namespace DownKyi.ViewModels.DownloadManager
break; break;
case DownloadStatus.DOWNLOADING: case DownloadStatus.DOWNLOADING:
downloading.Downloading.DownloadStatus = DownloadStatus.PAUSE; downloading.Downloading.DownloadStatus = DownloadStatus.PAUSE;
downloading.StartOrPause = ButtonIcon.Instance().Start;
downloading.StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
break; break;
case DownloadStatus.DOWNLOAD_SUCCEED: case DownloadStatus.DOWNLOAD_SUCCEED:
// 下载成功后会从下载列表中删除 // 下载成功后会从下载列表中删除
@ -63,9 +67,6 @@ namespace DownKyi.ViewModels.DownloadManager
default: default:
break; break;
} }
downloading.StartOrPause = ButtonIcon.Instance().Start;
downloading.StartOrPause.Fill = DictionaryResource.GetColor("ColorPrimary");
} }
} }

@ -100,68 +100,56 @@
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border <Button
Grid.Column="0" Grid.Column="0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="{DynamicResource BrushBackground}" Command="{Binding OpenFolderCommand}"
Cursor="Hand"> Style="{StaticResource ImageBtnStyle}"
<i:Interaction.Triggers> ToolTip="{DynamicResource OpenFolder}">
<i:EventTrigger EventName="MouseLeftButtonUp"> <ContentControl Width="20" Height="20">
<i:InvokeCommandAction Command="{Binding OpenFolderCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ContentControl>
<Path <Path
Width="{Binding OpenFolder.Width}" Width="{Binding OpenFolder.Width}"
Height="{Binding OpenFolder.Height}" Height="{Binding OpenFolder.Height}"
Data="{Binding OpenFolder.Data}" Data="{Binding OpenFolder.Data}"
Fill="{Binding OpenFolder.Fill}" Fill="{Binding OpenFolder.Fill}"
Stretch="UniformToFill" /> Stretch="Uniform" />
</ContentControl> </ContentControl>
</Border> </Button>
<Border <Button
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="{DynamicResource BrushBackground}" Command="{Binding OpenVideoCommand}"
Cursor="Hand"> Style="{StaticResource ImageBtnStyle}"
<i:Interaction.Triggers> ToolTip="{DynamicResource OpenVideo}">
<i:EventTrigger EventName="MouseLeftButtonUp"> <ContentControl Width="20" Height="20">
<i:InvokeCommandAction Command="{Binding OpenVideoCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ContentControl>
<Path <Path
Width="{Binding OpenVideo.Width}" Width="{Binding OpenVideo.Width}"
Height="{Binding OpenVideo.Height}" Height="{Binding OpenVideo.Height}"
Data="{Binding OpenVideo.Data}" Data="{Binding OpenVideo.Data}"
Fill="{Binding OpenVideo.Fill}" Fill="{Binding OpenVideo.Fill}"
Stretch="UniformToFill" /> Stretch="Uniform" />
</ContentControl> </ContentControl>
</Border> </Button>
<Border <Button
Grid.Column="2" Grid.Column="2"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="{DynamicResource BrushBackground}" Command="{Binding RemoveVideoCommand}"
Cursor="Hand"> Style="{StaticResource ImageBtnStyle}"
<i:Interaction.Triggers> ToolTip="{DynamicResource DeleteDownload}">
<i:EventTrigger EventName="MouseLeftButtonUp"> <ContentControl Width="20" Height="20">
<i:InvokeCommandAction Command="{Binding RemoveVideoCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ContentControl>
<Path <Path
Width="{Binding RemoveVideo.Width}" Width="{Binding RemoveVideo.Width}"
Height="{Binding RemoveVideo.Height}" Height="{Binding RemoveVideo.Height}"
Data="{Binding RemoveVideo.Data}" Data="{Binding RemoveVideo.Data}"
Fill="{Binding RemoveVideo.Fill}" Fill="{Binding RemoveVideo.Fill}"
Stretch="UniformToFill" /> Stretch="Uniform" />
</ContentControl> </ContentControl>
</Border> </Button>
</Grid> </Grid>
</Grid> </Grid>

@ -160,47 +160,39 @@
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border <Button
Grid.Column="0" Grid.Column="0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="{DynamicResource BrushBackground}" Command="{Binding StartOrPauseCommand}"
Cursor="Hand"> Style="{StaticResource ImageBtnStyle}"
<i:Interaction.Triggers> ToolTip="{Binding OperationTip}">
<i:EventTrigger EventName="MouseLeftButtonUp"> <ContentControl Width="20" Height="20">
<i:InvokeCommandAction Command="{Binding StartOrPauseCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ContentControl>
<Path <Path
Width="{Binding StartOrPause.Width}" Width="{Binding StartOrPause.Width}"
Height="{Binding StartOrPause.Height}" Height="{Binding StartOrPause.Height}"
Data="{Binding StartOrPause.Data}" Data="{Binding StartOrPause.Data}"
Fill="{Binding StartOrPause.Fill}" Fill="{Binding StartOrPause.Fill}"
Stretch="UniformToFill" /> Stretch="Uniform" />
</ContentControl> </ContentControl>
</Border> </Button>
<Border <Button
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="{DynamicResource BrushBackground}" Command="{Binding DeleteCommand}"
Cursor="Hand"> Style="{StaticResource ImageBtnStyle}"
<i:Interaction.Triggers> ToolTip="{DynamicResource DeleteDownload}">
<i:EventTrigger EventName="MouseLeftButtonUp"> <ContentControl Width="20" Height="20">
<i:InvokeCommandAction Command="{Binding DeleteCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ContentControl>
<Path <Path
Width="{Binding Delete.Width}" Width="{Binding Delete.Width}"
Height="{Binding Delete.Height}" Height="{Binding Delete.Height}"
Data="{Binding Delete.Data}" Data="{Binding Delete.Data}"
Fill="{Binding Delete.Fill}" Fill="{Binding Delete.Fill}"
Stretch="UniformToFill" /> Stretch="Uniform" />
</ContentControl> </ContentControl>
</Border> </Button>
</Grid> </Grid>
</Grid> </Grid>

Loading…
Cancel
Save