/// <summary> /// Handles the Click event of the TOP control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private async void TOP_Click(object sender, RoutedEventArgs e) { var ScrollToTopString = "var int = setInterval(function(){window.scrollBy(0, -36); if( window.pageYOffset === 0 ) clearInterval(int); }, 0.1);"; switch (Vars.WhatSocialNetwork) { case 0: { await AllSocial0.InvokeScriptAsync("eval", new string[] { ScrollToTopString }); break; } case 1: { await AllSocial1.InvokeScriptAsync("eval", new string[] { ScrollToTopString }); break; } case 2: { await AllSocial2.InvokeScriptAsync("eval", new string[] { ScrollToTopString }); break; } case 3: { await AllSocial3.InvokeScriptAsync("eval", new string[] { ScrollToTopString }); break; } case 4: { await AllSocial4.InvokeScriptAsync("eval", new string[] { ScrollToTopString }); break; } } }
/// <summary> /// Goes the home. /// </summary> private void Go_Home() { iconRotation.Begin(); Uri mwv; // Contains the source URL for Facebook Touch mwv = new Uri(Vars.MyWebViewSource); switch (Vars.WhatSocialNetwork) { case 0: { AllSocial0.Navigate(new Uri(Vars.MyWebViewSource)); break; } case 1: { AllSocial1.Navigate(new Uri(Vars.MyWebViewSource)); break; } case 2: { AllSocial2.Navigate(new Uri(Vars.MyWebViewSource)); break; } case 3: { AllSocial3.Navigate(new Uri(Vars.MyWebViewSource)); break; } case 4: { AllSocial4.Navigate(new Uri(Vars.MyWebViewSource)); break; } } }
/// <summary> /// Handles the Click event of the REFRESH control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param> private void REFRESH_Click(object sender, RoutedEventArgs e) { iconRotation.Begin(); switch (Vars.WhatSocialNetwork) { case 0: { AllSocial0.Refresh(); break; } case 1: { AllSocial1.Refresh(); break; } case 2: { AllSocial2.Refresh(); break; } case 3: { AllSocial3.Refresh(); break; } case 4: { AllSocial4.Refresh(); break; } } }
/// <summary> /// Handles the Loaded event of the MainPage control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void MainPage_Loaded(object sender, RoutedEventArgs e) { HardwareButtons.BackPressed += BackPressed; SIDEBAR.Visibility = Visibility.Collapsed; Info.Visibility = Visibility.Collapsed; iconRotation.Begin(); SystemNavigationManager.GetForCurrentView().BackRequested += (s, a) => { switch (Vars.WhatSocialNetwork) { case 0: { if (AllSocial0.CanGoBack) { AllSocial0.GoBack(); a.Handled = true; } break; } case 1: { if (AllSocial1.CanGoBack) { AllSocial2.GoBack(); a.Handled = true; } break; } case 2: { if (AllSocial2.CanGoBack) { AllSocial2.GoBack(); a.Handled = true; } break; } case 3: { if (AllSocial3.CanGoBack) { AllSocial3.GoBack(); a.Handled = true; } break; } case 4: { if (AllSocial4.CanGoBack) { AllSocial4.GoBack(); a.Handled = true; } break; } } }; SelectNetwork(0); }
/// <summary> /// Backs the pressed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="BackPressedEventArgs"/> instance containing the event data.</param> public async void BackPressed(object sender, BackPressedEventArgs e) { // Handles any Back button presses. e.Handled = true; switch (Vars.WhatSocialNetwork) { case 0: { if (AllSocial0.CanGoBack) { AllSocial0.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 1: { if (AllSocial1.CanGoBack) { AllSocial1.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 2: { if (AllSocial2.CanGoBack) { AllSocial2.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 3: { if (AllSocial3.CanGoBack) { AllSocial3.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 4: { if (AllSocial4.CanGoBack) { AllSocial4.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } } }
/// <summary> /// Handles the Click event of the BACK control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private async void BACK_Click(object sender, RoutedEventArgs e) { switch (Vars.WhatSocialNetwork) { case 0: { if (AllSocial0.CanGoBack) { AllSocial0.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 1: { if (AllSocial1.CanGoBack) { AllSocial1.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 2: { if (AllSocial2.CanGoBack) { AllSocial2.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 3: { if (AllSocial3.CanGoBack) { AllSocial3.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } case 4: { if (AllSocial4.CanGoBack) { AllSocial4.GoBack(); } else { await Vars.displayMessageAsync("Quit " + Vars.AppName, "Are you sure you want to quit the app?", ""); } break; } } }