private void AddButton_Click(object sender, RoutedEventArgs e) { var dlg = new EditAlarmDlg(-1) { WindowStartupLocation = WindowStartupLocation.CenterOwner, Owner = this, }; if ((bool)dlg.ShowDialog()) { AddAudibleAlarmItems(); AlarmManager.LoadAlarms(); } }
private void EditButton_Click(object sender, RoutedEventArgs e) { var selectedItem = ((VMSListBoxItem)AlarmsList.SelectedItem); if (selectedItem != null) { var itemId = selectedItem.ID; var dlg = new EditAlarmDlg(itemId) { WindowStartupLocation = WindowStartupLocation.CenterOwner, Owner = this, }; if ((bool)dlg.ShowDialog()) { AddAudibleAlarmItems(); AlarmManager.LoadAlarms(); } } }