Ejemplo n.º 1
0
        private void Button_EnterToPersonalSpace_Click(object sender, RoutedEventArgs e)
        {
            AuthorizationProcessing();

            Timer.Interval = TimeSpan.FromSeconds(1);
            Timer.Tick    += (s, ev) =>
            {
                if (MyMember.Autorization())
                {
                    MyMember.LoadFromBase();
                    Grid_Authorization.BeginAnimation(OpacityProperty, new DoubleAnimation(1, 0, TimeSpan.FromSeconds(0.2)));
                    Grid_Authorization.Visibility = Visibility.Hidden;
                    Grid_PersonalSpace.Visibility = Visibility.Visible;
                    Grid_PersonalSpace.Opacity    = 0;
                    Grid_PersonalSpace.BeginAnimation(OpacityProperty, new DoubleAnimation(0, 1, TimeSpan.FromSeconds(0.2)));
                }
                else
                {
                    Label_ConnectionInfo.Content = "Error.";
                    Border_Connecting_and_login.BeginAnimation(MarginProperty, new ThicknessAnimation(new Thickness(350, 0, 350, 0), new Thickness(350, 0, 350, -100), TimeSpan.FromSeconds(1)));
                    Border_GrayWallTransparent.Visibility = Visibility.Hidden;
                    PasswordBox_Password.IsEnabled        = true;
                    TextBox_Login.IsEnabled = true;
                }
                Timer.Stop();
            };
            Timer.Start();
        }
Ejemplo n.º 2
0
        private void AuthorizationProcessing()
        {
            PasswordBox_Password.IsEnabled        = false;
            TextBox_Login.IsEnabled               = false;
            MyMember.Person.Login                 = TextBox_Login.Text;
            MyMember.Person.Password              = PasswordBox_Password.Password;
            Label_ConnectionInfo.Content          = "Connecting to server...";
            Border_GrayWallTransparent.Visibility = Visibility.Visible;

            Border_GrayWallTransparent.BeginAnimation(OpacityProperty,
                                                      new DoubleAnimation(0, 0.2, TimeSpan.FromSeconds(0.5)));
            Border_Connecting_and_login.BeginAnimation(MarginProperty,
                                                       new ThicknessAnimation(new Thickness(350, 0, 350, -100),
                                                                              new Thickness(350, 0, 350, 0), TimeSpan.FromSeconds(0.5)));
        }