private void btnMyProfile_Click(object sender, EventArgs e) { ProfileWindow newWindow = new ProfileWindow(Connection.loggedUserEmail); newWindow.StartPosition = FormStartPosition.Manual; newWindow.Location = new Point(this.Location.X, this.Location.Y); newWindow.Show(); this.Close(); }
private void EditProfileButton_Click(object sender, RoutedEventArgs e) { if (ProfileWindow == null) { ProfileWindow = new ProfileWindow(LoggedUser, this); } Application.Current.MainWindow = ProfileWindow; ProfileWindow.Show(); }
public MainWindow(UserData user) { RoomResults = new List <Room>(); OpenWindows = new List <GameWindow>(); Replays = new List <TupleModel <string, string> >(); ProfileWindow = null; InitializeComponent(); RoomsGrid.ItemsSource = RoomResults; ReplayGrid.ItemsSource = Replays; LoggedUser = user; _loggedIn = true; DataContext = LoggedUser; UpdateAvatar(LoggedUser.AvatarPath); ReplayRequest(); }
private void btnLogIn_Click(object sender, EventArgs e) { Packet logInPacket = new Packet(Packet.PacketType.LogIn, Connection.id); Connection.loggedUserEmail = tbEmail.Text; logInPacket.gData.Add(tbEmail.Text); logInPacket.gData.Add(tbPassword.Text); Connection.master.Send(logInPacket.ToBytes()); Thread.Sleep(500); if (Connection.isValidUser) { ProfileWindow newWindow = new ProfileWindow(Connection.loggedUserEmail); newWindow.StartPosition = FormStartPosition.Manual; newWindow.Location = new Point(this.Location.X, this.Location.Y); newWindow.Show(); this.Hide(); } else { MessageBox.Show(Connection.logInMessage); } }