コード例 #1
0
        private void ShowSelectedProperties()
        {
            var selected = lvwUsers.SelectedItem as UserSearchResultViewModel;

            if (selected != null)
            {
                var frm = new UserProperties(User, selected.Username);
                frm.Owner = this.FindParentWindow();
                frm.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                if (frm.ShowDialog() == true)
                {
                    ReloadModel();
                }
            }
        }
コード例 #2
0
        private void AddNewUser()
        {
            var frm = new UserProperties(User, null);

            frm.Owner = this.FindParentWindow();
            frm.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            frm.ShowDialog();

            ReloadModel();
            string username = frm.txtUsername.Text;
            var    newItem  = _users.FirstOrDefault((m) => {
                return(m.Username.Equals(username));
            });

            lvwUsers.SelectedItem = newItem;
        }