Example #1
0
 private void ButtonLogin_Click(object sender, RoutedEventArgs e)
 {
     if (UserName.Text.ToString().Equals("admin") && Pwd.Password.ToString().Equals("12345"))
     {
         WindowPrincipale windows = new WindowPrincipale();
         windows.Show();
         this.Close();
     }
     else
     {
         i++;
         if (i < 3)
         {
             MsgError.Text = "Login or Password is incorrect";
         }
         else if (i >= 3 && i < 5)
         {
         }
         else
         {
             MsgError.Text = "Vous avez fait plus de 4 essaies l'application va s'arreter WARNING !!!";
             Application.Current.Shutdown();
         }
     }
 }
        private void ButtonClose_Click(object sender, RoutedEventArgs e)
        {
            WindowPrincipale windows = new WindowPrincipale();

            windows.Show();
            this.Close();
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((LoginWpf.WindowPrincipale)(target));
                return;

            case 2:
                this.CloseMenu_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target));
                return;

            case 3:
                this.GridMenu = ((System.Windows.Controls.Grid)(target));
                return;

            case 4:
                this.MainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.ButtonClose2 = ((System.Windows.Controls.Button)(target));

            #line 113 "..\..\WindowPrincipale.xaml"
                this.ButtonClose2.Click += new System.Windows.RoutedEventHandler(this.ButtonClose_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.ButtonCloseMenu = ((System.Windows.Controls.Button)(target));

            #line 118 "..\..\WindowPrincipale.xaml"
                this.ButtonCloseMenu.Click += new System.Windows.RoutedEventHandler(this.ButtonCloseMenu_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.ButtonOpenMenu = ((System.Windows.Controls.Button)(target));

            #line 121 "..\..\WindowPrincipale.xaml"
                this.ButtonOpenMenu.Click += new System.Windows.RoutedEventHandler(this.ButtonOpenMenu_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.ButtonClose = ((System.Windows.Controls.Button)(target));

            #line 126 "..\..\WindowPrincipale.xaml"
                this.ButtonClose.Click += new System.Windows.RoutedEventHandler(this.ButtonClose_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }