Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            var person = Repos.Persons.Create("");
            var f      = new FrmEditPerson(person)
            {
                Title = "Добавление персоны"
            };

            if (f.ShowDialog() != true)
            {
                return;
            }
            Repos.Persons.Add(person);
            UiHelper.RefreshCollection(lstPersons.ItemsSource);
        }
Ejemplo n.º 2
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            if (lstPersons.SelectedItems.Count == 0)
            {
                return;
            }
            var person = (Person)lstPersons.SelectedItems[0];
            var f      = new FrmEditPerson(person)
            {
                Title = "Редактивароние персоны"
            };

            if (f.ShowDialog() != true)
            {
                return;
            }
            UiHelper.RefreshCollection(lstPersons.ItemsSource);
        }