Archived
1
0

Items cards' context menu. Fixed duplicating authors' name on comments replies. Another version of logo

Related Work Items: #226
This commit is contained in:
Michael Gordeev
2018-12-31 01:42:11 +03:00
parent 7f4eaa0c7a
commit f136aa8d0c
9 changed files with 121 additions and 24 deletions
+33 -2
View File
@@ -4,12 +4,16 @@ using Windows.UI.Xaml.Controls;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Windows.UI.Xaml.Media.Imaging;
using System.Xml;
using Windows.System;
using Windows.UI.Popups;
using Windows.ApplicationModel.DataTransfer;
using Windows.Foundation;
namespace FoxTube.Controls
{
/// <summary>
/// Video item card
/// </summary>
public sealed partial class VideoCard : UserControl
{
public string playlistId;
@@ -19,8 +23,9 @@ namespace FoxTube.Controls
bool embed = false;
public VideoCard(string id, string playlist = null)
{
this.InitializeComponent();
InitializeComponent();
Initialize(id, playlist);
DataTransferManager.GetForCurrentView().DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(Share);
}
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
@@ -105,5 +110,31 @@ namespace FoxTube.Controls
else
Methods.MainPage.GoToVideo(videoId, playlistId);
}
private void ViewChannel_Click(object sender, RoutedEventArgs e)
{
Methods.MainPage.GoToChannel(item.Snippet.ChannelId);
}
private void GetLink_Click(object sender, RoutedEventArgs e)
{
DataPackage data = new DataPackage();
data.SetText($"https://www.youtube.com/watch?v={videoId}");
Clipboard.SetContent(data);
}
private void Share_Click(object sender, RoutedEventArgs e)
{
DataTransferManager.ShowShareUI();
}
private void Share(DataTransferManager sender, DataRequestedEventArgs args)
{
Methods.Share(args,
item.Snippet.Thumbnails.Medium.Url,
item.Snippet.Title,
$"https://www.youtube.com/watch?v={videoId}",
"video");
}
}
}