예제 #1
0
        private async void HideUpdateChangelog()
        {
            var x = (float)UpdateChangeLogFlyout.ActualWidth / 2;
            var y = (float)UpdateChangeLogFlyout.ActualHeight / 2;

            await UpdateChangeLogFlyout.Scale(.9f, .9f, x, y).Fade(0).StartAsync();

            UpdateChangeLogFlyout.Visibility = Visibility.Collapsed;
            PagePivot.Blur(0).Start();

            PagePivot.IsEnabled = true;
            AppBar.IsEnabled    = true;
        }
예제 #2
0
        private async void ShowLastUpdateChangelog()
        {
            PagePivot.IsEnabled = false;
            AppBar.IsEnabled    = false;

            await UpdateChangeLogFlyout.Scale(.9f, .9f, 0, 0, 0).Fade(0).StartAsync();

            UpdateChangeLogFlyout.Visibility = Visibility.Visible;

            var x = (float)UpdateChangeLogFlyout.ActualWidth / 2;
            var y = (float)UpdateChangeLogFlyout.ActualHeight / 2;

            await UpdateChangeLogFlyout.Scale(1f, 1f, x, y).Fade(1).StartAsync();

            PagePivot.Blur(10, 500, 500).Start();
        }
예제 #3
0
        private async void ApplicationBarActionButton_Click(object sender, EventArgs e)
        {
            PagePivot.Focus();
            PendingOverlay.Visibility = Visibility.Visible;
            ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = false;
            ApplicationBar.IsMenuEnabled = false;
            var progress = new ProgressIndicator
            {
                IsVisible       = true,
                IsIndeterminate = true
            };

            switch (_pivotState)
            {
            case State.Login:
                progress.Text = "Logging into Snapchat securely...";
                SystemTray.SetProgressIndicator(this, progress);

                Tuple <TempEnumHolder.LoginStatus, Account> repsonse =
                    await Functions.Login(TextUsername.Text, TextPassword.Password);

                switch (repsonse.Item1)
                {
                case TempEnumHolder.LoginStatus.InvalidCredentials:
                    MessageBox.Show("Your username/password is incorrect.", "Invalid Credentials",
                                    MessageBoxButton.OK);
                    break;

                case TempEnumHolder.LoginStatus.ServerError:
                    MessageBox.Show("Unable to connect to server. Check your Internet Connection.", "Oops",
                                    MessageBoxButton.OK);
                    break;

                case TempEnumHolder.LoginStatus.Success:
                    // Tell User we be syncing
                    progress.Text = "Syncing with Snapchat securely...";
                    SystemTray.SetProgressIndicator(this, progress);

                    // Sync Other Shit
                    Dictionary <string, Best> bests =
                        await Functions.GetBests(repsonse.Item2.Friends, repsonse.Item2.UserName, repsonse.Item2.AuthToken);

                    if (bests != null)
                    {
                        App.IsolatedStorage.UserAccount  = repsonse.Item2;
                        App.IsolatedStorage.FriendsBests = bests;

                        // Navigate to Capture Page
                        NavigationService.Navigate(
                            Navigation.GenerateNavigateUri(Navigation.NavigationTarget.Capture));
                    }
                    else
                    {
                        MessageBox.Show(
                            "Unable to sync with Snapchat's servers. Check your internet connection and try logging in again.",
                            "Syncing Error", MessageBoxButton.OK);
                    }
                    break;
                }
                break;

            case State.Register:
                progress.Text = "Registering your account with Snapchat securely...";
                SystemTray.SetProgressIndicator(this, progress);

                MessageBox.Show("Haven't coded this yet", "nope.", MessageBoxButton.OK);
                break;
            }

            PendingOverlay.Visibility = Visibility.Collapsed;
            progress = new ProgressIndicator {
                IsVisible = false
            };
            SystemTray.SetProgressIndicator(this, progress);
            ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = true;
            ApplicationBar.IsMenuEnabled = true;
        }