diff --git a/FoxTube/Controls/ChannelCard.xaml b/FoxTube/Controls/ChannelCard.xaml index 0fa457e..3f12fbe 100644 --- a/FoxTube/Controls/ChannelCard.xaml +++ b/FoxTube/Controls/ChannelCard.xaml @@ -57,7 +57,8 @@ - + + diff --git a/FoxTube/Controls/ChannelCard.xaml.cs b/FoxTube/Controls/ChannelCard.xaml.cs index 91cfce0..1b86418 100644 --- a/FoxTube/Controls/ChannelCard.xaml.cs +++ b/FoxTube/Controls/ChannelCard.xaml.cs @@ -2,7 +2,7 @@ using Google.Apis.YouTube.v3.Data; using System; using Windows.ApplicationModel.DataTransfer; -using Windows.Foundation; +using Windows.System; using Windows.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; @@ -23,7 +23,6 @@ namespace FoxTube.Controls { InitializeComponent(); Initialize(id, live); - DataTransferManager.GetForCurrentView().DataRequested += new TypedEventHandler(Share); } private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e) @@ -106,18 +105,9 @@ namespace FoxTube.Controls Clipboard.SetContent(data); } - private void Share_Click(object sender, RoutedEventArgs e) + private async void InBrowser_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, - string.IsNullOrWhiteSpace(item.Snippet.CustomUrl) ? $"https://www.youtube.com/channel/{item.Id}" : $"https://www.youtube.com/user/{item.Snippet.CustomUrl}", - "channel"); + await Launcher.LaunchUriAsync((string.IsNullOrWhiteSpace(item.Snippet.CustomUrl) ? $"https://www.youtube.com/channel/{item.Id}" : $"https://www.youtube.com/user/{item.Snippet.CustomUrl}").ToUri()); } } } diff --git a/FoxTube/Controls/PlaylistCard.xaml b/FoxTube/Controls/PlaylistCard.xaml index 1c4d1ed..1597f7b 100644 --- a/FoxTube/Controls/PlaylistCard.xaml +++ b/FoxTube/Controls/PlaylistCard.xaml @@ -54,7 +54,8 @@ - + + diff --git a/FoxTube/Controls/PlaylistCard.xaml.cs b/FoxTube/Controls/PlaylistCard.xaml.cs index b91d6d1..ddcbc0f 100644 --- a/FoxTube/Controls/PlaylistCard.xaml.cs +++ b/FoxTube/Controls/PlaylistCard.xaml.cs @@ -2,7 +2,7 @@ using Google.Apis.YouTube.v3.Data; using System; using Windows.ApplicationModel.DataTransfer; -using Windows.Foundation; +using Windows.System; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media.Imaging; @@ -21,7 +21,6 @@ namespace FoxTube.Controls { InitializeComponent(); Initialize(id); - DataTransferManager.GetForCurrentView().DataRequested += new TypedEventHandler(Share); } public async void Initialize(string id) @@ -70,18 +69,9 @@ namespace FoxTube.Controls Clipboard.SetContent(data); } - private void Share_Click(object sender, RoutedEventArgs e) + private async void InBrowser_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/playlist?list={item.Id}", - "playlist"); + await Launcher.LaunchUriAsync($"https://www.youtube.com/playlist?list={playlistId}".ToUri()); } } } diff --git a/FoxTube/Controls/VideoCard.xaml b/FoxTube/Controls/VideoCard.xaml index 11273f9..9135815 100644 --- a/FoxTube/Controls/VideoCard.xaml +++ b/FoxTube/Controls/VideoCard.xaml @@ -62,7 +62,8 @@ - + + diff --git a/FoxTube/Controls/VideoCard.xaml.cs b/FoxTube/Controls/VideoCard.xaml.cs index 1d861ea..12e9451 100644 --- a/FoxTube/Controls/VideoCard.xaml.cs +++ b/FoxTube/Controls/VideoCard.xaml.cs @@ -7,7 +7,6 @@ using Windows.UI.Xaml.Media.Imaging; using Windows.System; using Windows.UI.Popups; using Windows.ApplicationModel.DataTransfer; -using Windows.Foundation; namespace FoxTube.Controls { @@ -25,7 +24,6 @@ namespace FoxTube.Controls { InitializeComponent(); Initialize(id, playlist); - DataTransferManager.GetForCurrentView().DataRequested += new TypedEventHandler(Share); } private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e) @@ -123,18 +121,9 @@ namespace FoxTube.Controls Clipboard.SetContent(data); } - private void Share_Click(object sender, RoutedEventArgs e) + private async void InBrowser_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"); + await Launcher.LaunchUriAsync($"https://www.youtube.com/watch?v={videoId}".ToUri()); } } } diff --git a/FoxTube/Controls/VideoPlayer.xaml.cs b/FoxTube/Controls/VideoPlayer.xaml.cs index 2d65a9b..0abc0cc 100644 --- a/FoxTube/Controls/VideoPlayer.xaml.cs +++ b/FoxTube/Controls/VideoPlayer.xaml.cs @@ -393,7 +393,7 @@ namespace FoxTube private void UserControl_PointerExited(object sender, PointerRoutedEventArgs e) { - if (t.Enabled && e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse) + if (ctrlsFadeTimer.IsEnabled && e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse) { pointerCaptured = false; Elapsed(this, null); diff --git a/FoxTube/Pages/VideoPage.xaml.cs b/FoxTube/Pages/VideoPage.xaml.cs index 79ad556..c3a6e27 100644 --- a/FoxTube/Pages/VideoPage.xaml.cs +++ b/FoxTube/Pages/VideoPage.xaml.cs @@ -382,7 +382,7 @@ namespace FoxTube.Pages string timecode = player.elapsed.TotalSeconds > 10 ? "&t=" + (int)player.elapsed.TotalSeconds + "s" : string.Empty; - await Launcher.LaunchUriAsync(new Uri($"https://www.youtube.com/watch?v={videoId}{timecode}")); + await Launcher.LaunchUriAsync($"https://www.youtube.com/watch?v={videoId}{timecode}".ToUri()); } public void refresh_Click(object sender, RoutedEventArgs e)