WPF Popup Window


     we can use a WPF Popup window using show dialogBox. Hope code will be clear to you.

  // Main window any event  
  private void LoadListOfEmployee()  
             // Pop Up window open  
       PopUpEmployeeInfoList objPopupEmployeeList = new PopUpEmployeeInfoList();  
       if (objPopupEmployeeList.ShowDialog() == true)  
                  EEmployeeInfo eEmoloyeeInfoObj = new EEmployeeInfo();  
                  // Casting Popup window data   
         eEmoloyeeInfoObj = objPopupEmployeeList.employesLstView.SelectedItem as EEmployeeInfo;  
                     // Setting popupwindow data to main window control  
         textEmployeeCode.Text = eEmoloyeeInfoObj.EmployeeCode;  
         tenureEmployeeCodeTextBox.Text = eEmoloyeeInfoObj.EmployeeCode;  
         releaseEmployeeCodeTextBox.Text = eEmoloyeeInfoObj.EmployeeCode;  

 // Pop Up window Event  
           // using this.DialogResult = true; popup window replace the control to main window  
            private void employesLstView_KeyDown(object sender, KeyEventArgs e)  
       if (employesLstView.SelectedIndex > -1)  
         if (e.Key == Key.Enter)  
           this.DialogResult = true;  

Popular posts from this blog

mvc razor textboxfor change event change another textboxfor value

WPF Crystal Report Viewer Using SAP

ASP.NET MVC razor SAP Crystal report