private void AddButton_Click(object sender, RoutedEventArgs e) { TextLogEditor w = new TextLogEditor(); TextLogEditorModel m = new TextLogEditorModel(); w.ViewModel = m; if (w.ShowDialog() == true) { LogFile nel = w.ViewModel.GetValues(); this.Logs.Add(nel); this.parserLogsGrid.SelectedItem = nel; } }
private void EditButton_Click(object sender, RoutedEventArgs e) { if (this.parserLogsGrid.SelectedItem == null) { return; } TextLogEditor w = new TextLogEditor(); TextLogEditorModel m = new TextLogEditorModel(); w.ViewModel = m; LogFile c = (LogFile)this.parserLogsGrid.SelectedItem; w.ViewModel.SetValues(c); if (w.ShowDialog() == true) { LogFile nc = w.ViewModel.GetValues(); this.Logs.Remove(c); this.Logs.Add(nc); this.parserLogsGrid.SelectedItem = nc; } }
private void EditButton_Click(object sender, RoutedEventArgs e) { if (this.parserLogsGrid.SelectedItem == null) return; TextLogEditor w = new TextLogEditor(); TextLogEditorModel m = new TextLogEditorModel(); w.ViewModel = m; LogFile c = (LogFile)this.parserLogsGrid.SelectedItem; w.ViewModel.SetValues(c); if (w.ShowDialog() == true) { LogFile nc = w.ViewModel.GetValues(); this.Logs.Remove(c); this.Logs.Add(nc); this.parserLogsGrid.SelectedItem = nc; } }