//Login window which passes the user object to the next window try{ loginUser = SQLuserAccess.UserLogin(txtUsername.Text, txtPassword.Password.ToString()); if (txtUsername.Text == loginUser.Username && txtPassword.Password == loginUser.Password) { if (loginUser.IsAdmin == true) { Window showAdminSrc = new AdminWindow(loginUser); showAdminSrc.Show(); Close(); } else if (loginUser.IsAdmin == false){ Window nonAdmin = new CustomerScreen(loginUser); nonAdmin.Show(); Close(); } else lblInvalidText.Content = "Admin is not True or False!"; } //Adminwindow screen which takes object public AdminWindow(User user) { adminUser = user; InitializeComponent(); //Display specific username on window. TextBlockName.Text = "Hello:" + Environment.NewLine +user.Username; } //The control in .xaml <TextBlock x:Name="TextBlockName" TextWrapping="Wrap" HorizontalAlignment="Right" Margin="0,30,35,0" FontSize="16">Hello:<!--<LineBreak /><Run Text="{Binding Username}"/>--></TextBlock> //AND HERE IS SOMETHING I WAS TRYING DATA BINDING BUT HAVE NOT FIGURED OUT <!-- LEARN DATA BINDING TEXTBLOCK TO DISPLAY USER OBJECT NAME. <TextBlock x:Name="TextBlockUsername" Text="{Binding Username}" HorizontalAlignment="Right" FontSize="16" Margin="0,60,35,0"/> -->
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)