private void buttonAddArea_Click(object sender, RoutedEventArgs e) { var windowAddArea = new Windows.ScopeWindows.EditNameWindow(); if (windowAddArea.ShowDialog() == true) { _scope.Add(new Area() { Name = windowAddArea.AreaName }); UpdateDataGridArea(); } }
private void dataGridMenyAreaEditName_Click(object sender, RoutedEventArgs e) { var selected = dataGridArea.SelectedItem as MyArea; if (selected == null) { return; } var windowAddArea = new Windows.ScopeWindows.EditNameWindow(selected.Name); if (windowAddArea.ShowDialog() == true) { selected.Area.Name = windowAddArea.AreaName; UpdateDataGridArea(); } }