private void DeleteLogEntry(LogEntryDataModel aLogEntry) { if (ConfirmDelete() == MessageBoxResult.Yes) { LogEntries.Remove(aLogEntry); CollectionIsDirty = true; } }
private void ApplyFilter(object sender, FilterEventArgs e) { LogEntryDataModel ldm = (LogEntryDataModel)e.Item; if (string.IsNullOrWhiteSpace(Filter) || Filter.Length == 0) { e.Accepted = true; } else { e.Accepted = ldm.Date.ToString().Contains(Filter) || ldm.Type.Contains(Filter) || ldm.EntryTitle.Contains(Filter); } }
private void ShowLogEntryProperties(LogEntryDataModel aLogEntry) { if (aLogEntry != null) { // Display LogEntry Properties Window LogEntryPropertiesWindow dlg = new LogEntryPropertiesWindow((Application.Current.MainWindow.ActualWidth / 3.3), (Application.Current.MainWindow.ActualHeight / 2), aLogEntry); dlg.Owner = Application.Current.MainWindow; dlg.ShowDialog(); if (!dlg.cancelled) { aLogEntry.Date = dlg.Date; aLogEntry.EntryTitle = dlg.EntryTitle; aLogEntry.Type = dlg.Type; CvsLogEntries.View.Refresh(); } } }