Esempio n. 1
0
        private void addElementBtn_Click(object sender, RoutedEventArgs e)
        {
            UserDlg window = new UserDlg();

            if (window.ShowDialog() == true)
            {
                UserInfo user = new UserInfo()
                {
                    Name    = window.MyName,
                    Surname = window.MySurname,
                    Mail    = window.MyMail
                };
                list.Items.Add(user);
            }
        }
Esempio n. 2
0
        private void editElementBtn_Click(object sender, RoutedEventArgs e)
        {
            UserDlg window = new UserDlg();

            window.MyName    = selectedUser.Name;
            window.MySurname = selectedUser.Surname;
            window.MyMail    = selectedUser.Mail;
            if (window.ShowDialog() == true)
            {
                selectedUser.Name    = window.MyName;
                selectedUser.Surname = window.MySurname;
                selectedUser.Mail    = window.MyMail;
                list.Items.Refresh();
                ((App)Application.Current).UpdateAll(selectedUser.Name, selectedUser.Surname, selectedUser.Mail);
            }
        }