... ...
Undertaking series (ii)
Before the login background has been set to send to the main interface:
Receive the value passed in the main interface:
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Windows;usingSystem.Windows.Controls;usingSystem.Windows.Data;usingSystem.Windows.Documents;usingSystem.Windows.Input;usingSystem.Windows.Media;usingSystem.Windows.Media.Imaging;usingSystem.Windows.Navigation;usingSystem.Windows.Shapes;usingSystem.Data.SqlClient;usingUser.sqlhelper;usingSystem.Data;usingSystem.IO;usingSystem.Drawing;namespaceuser{/// <summary> ///the interactive logic of MainWindow.xaml/// </summary> Public Partial classMainwindow:window { PublicMainWindow () {InitializeComponent (); }
#region start from here . Public Static stringName =""; Private voidWindow_Loaded (Objectsender, RoutedEventArgs e) {Myhelper.showwarnmessage+=Newmyhelper.showwarnmessage (myhelper_showwarnmessage); } //user name to pass the login interfaceUser_test _u =Newuser_test (); voidMyhelper_showwarnmessage (string_str) { //Get user name string_msg =_str; //Pass the name to the main pageName = Tb_name. Text =_msg; //Get permissions based on user name #endregion ended up here . Public Static BOOLIsNew =false; //New When you nest another user Control 2 on the main page Private voidBtn_new_click (Objectsender, RoutedEventArgs e) { //isnew = true; ////New //Uc_item _ucitem = new Uc_item (); ////Set Number initialization //_ucitem.tb_id. Text = "0"; ////_ucitem. } Private voidBtn_nosolve_click (Objectsender, RoutedEventArgs e) { } Private voidBtn_solve_click (Objectsender, RoutedEventArgs e) { } }}
Which references the
myhelper.showwarnmessage + = new myhelper.showwarnmessage (myhelper_showwarnmessage);
The MyHelper.cs code has been http://www.cnblogs.com/Owen-ET/p/5999654.html here.
Result diagram:
At last:
WPF learning notes How to pass the value of the first login interface to the next page display: Animation series (iii)