Beispiel #1
0
        private void DataGridRow_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var grid         = (DataGridRow)sender;
            var personWindow = new PersonWindow((int)comboBoxLocales.SelectedItem, (Person)grid.DataContext);

            personWindow.ShowDialog();
        }
        private void EditPerson(object obj)
        {
            var personWindow = new PersonWindow((int)locale, (Person)obj);

            personWindow.ShowDialog();

            RefreshGrid(PageSize, Page, (int)Locale, Search);
        }
Beispiel #3
0
        public void ShowEditUserDialog()
        {
            Console.Out.WriteLine("Edit dialog");
            PersonWindow pw = new PersonWindow(this, SelectedPerson)
            {
                Owner = _owner, Title = "Edit user"
            };

            pw.ShowDialog();
        }
Beispiel #4
0
        public void ShowAddUserDialog()
        {
            Console.Out.WriteLine("Add dialog");
            PersonWindow pw = new PersonWindow(this)
            {
                Owner = _owner, Title = "Add user"
            };

            pw.ShowDialog();
        }
Beispiel #5
0
        public void PersonWindowTest()
        {
            Person dPerson = new Person(1, "Ivanov", "Ivan", "Ivanovich", new DateTime(1995, 1, 1),
                                        new Sex(1, "Male"), new Locality(1, "Moscow"), new Locality(10, "Voronezh"), "+79066666666");

            dPerson.Hobbies.Add(new Hobby(1, "TestHobby"));

            Person dFriendPerson = new Person(1, "Sidorov", "Petr", "Ivanovich", new DateTime(1995, 1, 1),
                                              new Sex(1, "Male"), new Locality(1, "Moscow"), new Locality(10, "Voronezh"), "+79066666667");

            dPerson.LFriends.Add(dFriendPerson);
            dPerson.RFriends.Add(dFriendPerson);

            PersonWindowViewModel vm     = new PersonWindowViewModel(dPerson);
            PersonWindow          window = new PersonWindow();

            window.DataContext = vm;
            window.ShowDialog();
        }