Archived
1
0
#191: Done
This commit is contained in:
Michael Gordeev
2018-09-27 20:32:06 +03:00
parent 861631d0bd
commit 02327ad55d
4 changed files with 69 additions and 24 deletions
+28 -17
View File
@@ -144,6 +144,12 @@ namespace FoxTube
SetTitleBar();
}
public Video GetCurrentItem()
{
try { return (videoPlaceholder.Content as VideoPage).item; }
catch { return null; }
}
public void SetTitleBar()
{
var titleBar = ApplicationView.GetForCurrentView().TitleBar;
@@ -307,6 +313,7 @@ namespace FoxTube
public void GoToSearch(SearchParameters args)
{
nav.IsPaneOpen = false;
MinimizeAsInitializer();
content.Navigate(typeof(Search), args);
}
@@ -319,27 +326,31 @@ namespace FoxTube
public async void GoToVideo(string id, string playlistId = null)
{
var connection = NetworkInformation.GetInternetConnectionProfile().GetConnectionCost();
if ((bool)settings.Values["moblieWarning"] && (connection.NetworkCostType == NetworkCostType.Fixed || connection.NetworkCostType == NetworkCostType.Variable))
try
{
bool cancel = false;
MessageDialog dialog = new MessageDialog("You are on metered connection now. Additional charges may apply. Do you want to continue?")
var connection = NetworkInformation.GetInternetConnectionProfile().GetConnectionCost();
if ((bool)settings.Values["moblieWarning"] && (connection.NetworkCostType == NetworkCostType.Fixed || connection.NetworkCostType == NetworkCostType.Variable))
{
DefaultCommandIndex = 2,
CancelCommandIndex = 1
};
dialog.Commands.Add(new UICommand("Yes"));
dialog.Commands.Add(new UICommand("No", (command) => cancel = true));
dialog.Commands.Add(new UICommand("Add to 'Watch later' playlist", (command) =>
{
//TO-DO: Adding video to "Watch later"
cancel = true;
}));
await dialog.ShowAsync();
bool cancel = false;
MessageDialog dialog = new MessageDialog("You are on metered connection now. Additional charges may apply. Do you want to continue?")
{
DefaultCommandIndex = 2,
CancelCommandIndex = 1
};
dialog.Commands.Add(new UICommand("Yes"));
dialog.Commands.Add(new UICommand("No", (command) => cancel = true));
dialog.Commands.Add(new UICommand("Add to 'Watch later' playlist", (command) =>
{
//TO-DO: Adding video to "Watch later"
cancel = true;
}));
await dialog.ShowAsync();
if (cancel)
return;
if (cancel)
return;
}
}
catch { }
nav.IsPaneOpen = false;
+1 -1
View File
@@ -63,7 +63,7 @@ namespace FoxTube.Pages
public string videoId;
string playlistId = null;
Video item;
public Video item;
List<string> downloads = new List<string>();