Page 149 - DCAP408_WEB_PROGRAMMING
P. 149

Unit 9: Child and Pop Up Windows




                                                                                                Notes



             Notes  In my app, the login credentials are vital and canceling makes no sense. The user
             can  always back button or start button away from the app,  if they choose. The  child
             window’s  upper  right  corner  cancel  (icon  of  small  x)  is  also  removed  via
             HasCloseButton=”false” for the same reason.

          Loginchildwindow.xaml.cs

                using  System;
                using  System.Collections.Generic;
                using  System.Linq;
                using  System.Net;
                using  System.Windows;
                using  System.Windows.Controls;
                using  System.Windows.Documents;
                using  System.Windows.Input;
                using  System.Windows.Media;
                using  System.Windows.Media.Animation;
                using  System.Windows.Shapes;


                namespace  LoginChildWindow
             {
                      public  partial  class  LoginChildWindow  :  ChildWindow
                  {
                     public string Login { get; set; }
                            public  string  Password  { get;  set;  }

                                public  LoginChildWindow()
                     {
                         InitializeComponent();
                      }
                                  protected  override  void  OnOpened()
                     {
                          base.OnOpened();


                                  this.txtUserId.Text =  this.Login;
                     }
                                private  void  btnLogin_Click(object  sender,  RoutedEventArgs  e)
                     {
                         // test values




                                           LOVELY PROFESSIONAL UNIVERSITY                                   143
   144   145   146   147   148   149   150   151   152   153   154