private void OnClickNew(object sender, RoutedEventArgs e) { WorkType workType = new WorkType(); Windows.Adds.WindowAddWorkType window = new Adds.WindowAddWorkType(workType); if (window.ShowDialog() == true) { list.Add(workType); workType.Save(); } }
private void OnEditing(object sender, RoutedEventArgs e) { if (data.SelectedItem == null) { return; } WorkType workType = list[data.SelectedIndex]; Windows.Adds.WindowAddWorkType window = new Adds.WindowAddWorkType(workType); if (window.ShowDialog() == true) { workType.Update(); } }