Archived
1
0

DownloadAgent fixes and improvements

This commit is contained in:
Michael Gordeev
2018-07-12 10:57:33 +03:00
parent 71cc12106c
commit 9163fcf2ae
11 changed files with 172 additions and 98 deletions
+63 -3
View File
@@ -39,6 +39,12 @@ namespace FoxTube.Background
Thumbnail = thumbnailUrl;
}
public string GetXml()
{
return string.Empty;
}
public UIElement GetNotification()
{
StackPanel stackPanel = new StackPanel() { Margin = new Thickness(10, 0, 0, 0) };
@@ -155,17 +161,71 @@ namespace FoxTube.Background
break;
case NotificationType.Video:
template.LoadXml($@"<toast launch='action=viewPhoto&amp;photoId=92187'>
template.LoadXml($@"<toast launch='action=viewPhoto&amp;photoId=92187'>
<visual>
<binding template='ToastGeneric'>
<image placement='appLogoOverride' hint-crop='circle' src='{Avatar}'/>
<text>{Channel} uploaded a new video</text>
<text>{Content}</text>
<image src='{Thumbnail}'/>
</binding>
</visual>
<actions>
<action content='Watch later'
activationType='background'
arguments='likePhoto&amp;photoId=92187'/>
<action content='Go to channel'
arguments='action=commentPhoto&amp;photoId=92187'/>
</actions>
</toast>");
break;
case NotificationType.Internal:
string thumb1 = string.IsNullOrWhiteSpace(Thumbnail) ? "Assets/AnnouncementThumb.png" : Thumbnail;
<text>{Content}</text>
template.LoadXml($@"<toast launch='action=openThread&amp;threadId=92187'>
<visual>
<binding template='ToastGeneric'>
<image placement='hero' src='{thumb1}'/>
<image placement='appLogoOverride' hint-crop='circle' src='Assets/LogoAvatar.png'/>
<text>{Channel}</text>
<text hint-maxLines='5'>{Content}</text>
</binding>
</visual>
<actions>
<action content='Watch full post'
arguments='action=commentPhoto&amp;photoId=92187'/>
<action content='Manage notifications'
arguments='action=commentPhoto&amp;photoId=92187'/>
</actions>
</toast>");
break;
case NotificationType.Post:
string thumb2 = string.IsNullOrWhiteSpace(Thumbnail) ? "" : $"<image placement='hero' src ='{Thumbnail}'/>";
<actions>
template.LoadXml($@"<toast launch='action=openThread&amp;threadId=92187'>
<visual>
<binding template='ToastGeneric'>
{thumb2}
<image placement='appLogoOverride' hint-crop='circle' src='{Avatar}'/>
<text>{Channel}</text>
<text hint-maxLines='5'>{Content}</text>
</binding>
</visual>
<actions>
<input id='textBox' type='text' placeHolderContent='Leave a comment'/>
<action content='Send'
imageUri='Assets/Icons/send.png'
hint-inputId='textBox'
activationType='background'
arguments='action=reply&amp;threadId=92187'/>
<action content='Like'
arguments='action=commentPhoto&amp;photoId=92187'/>
</actions>
</toast>");
break;
}