Пример #1
0
        private async void PINOk(object sender, RoutedEventArgs e)
        {
            bool result = await _imgurhelper.Login(Box_PIN.Text);

            if (result)
            {
                DoubleAnimation fadePanelOut = _fadeOut;
                fadePanelOut.Completed += delegate {
                    DoubleAnimation fadeBtnIn = _fadeIn;
                    fadeBtnIn.Completed += delegate {
                        Panel_PIN.Visibility = Visibility.Collapsed;
                    };
                    Btn_SignOut.Visibility = Visibility.Visible;
                    Btn_SignOut.BeginAnimation(StackPanel.OpacityProperty, fadeBtnIn);
                };
                Panel_PIN.BeginAnimation(Button.OpacityProperty, fadePanelOut);

                if (_imgurhelper.User != null)
                {
                    Label_Account.Content = Label_Account.Content as string + " (Logged In as " + _imgurhelper.User + ")";

                    Btn_SignIn.Visibility  = Visibility.Collapsed;
                    Btn_SignOut.Visibility = Visibility.Visible;
                }
                Box_PIN.Clear();
            }
        }
Пример #2
0
        private async void PINOk(object sender, RoutedEventArgs e)
        {
            bool result = await _imgurhelper.Login(Box_PIN.Text);

            if (!result)
            {
                return;
            }
            DoubleAnimation fadePanelOut = Animations.FadeOut;

            fadePanelOut.Completed += delegate {
                DoubleAnimation fadeBtnIn = Animations.FadeIn;
                fadeBtnIn.Completed   += delegate { Panel_PIN.Visibility = Visibility.Collapsed; };
                Btn_SignOut.Visibility = Visibility.Visible;
                Btn_SignOut.BeginAnimation(OpacityProperty, fadeBtnIn);
                Btn_ViewPics.Visibility = Visibility.Visible;
                Btn_ViewPics.BeginAnimation(OpacityProperty, fadeBtnIn);
            };
            Panel_PIN.BeginAnimation(OpacityProperty, fadePanelOut);

            if (_imgurhelper.User != null)
            {
                Label_Account.Content = string.Format(str.imgurAccSignedIn, _imgurhelper.User);

                Btn_SignIn.Visibility   = Visibility.Collapsed;
                Btn_SignOut.Visibility  = Visibility.Visible;
                Btn_ViewPics.Visibility = Visibility.Visible;
            }
            Box_PIN.Clear();
        }