Exemplo n.º 1
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;
        }
        }
    }
Exemplo n.º 2
0
    /// <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;
        }
        }
    }