Items cards' context menu. Fixed duplicating authors' name on comments replies. Another version of logo
Related Work Items: #226
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user