private void Find_Executed(object sender, ExecutedRoutedEventArgs e) { string findName = FindBar.Text; DataSectionStack.Children.Clear(); currentPrograms.Clear(); currentPrograms = ProgramDataService.FindByName(findName); if (currentPrograms != null && currentPrograms.Count > 0) { PrintCurrentPrograms(); } UndoRedoStack.Command command = new UndoRedoStack.Command(() => { DataSectionStack.Children.Clear(); currentPrograms.Clear(); currentPrograms = ProgramDataService.FindByName(findName); if (currentPrograms != null && currentPrograms.Count > 0) { PrintCurrentPrograms(); } }); undoRedo.AddAction(command); }
private void Filters_Executed(object sender, ExecutedRoutedEventArgs e) { if (ByNameButton.IsChecked == true) { UndoRedoStack.Command command = new UndoRedoStack.Command(() => { SortByName(); PrintCurrentPrograms(); }); undoRedo.AddAction(command); SortByName(); PrintCurrentPrograms(); ByNameButton.IsChecked = false; } else if (ByPriceButton.IsChecked == true) { UndoRedoStack.Command command = new UndoRedoStack.Command(() => { SortByPrice(); PrintCurrentPrograms(); }); undoRedo.AddAction(command); SortByPrice(); PrintCurrentPrograms(); ByPriceButton.IsChecked = false; } else { MessageBox.Show("Please, choose type for filter..."); } }
private void CategorySort_Web_Executed(object sender, ExecutedRoutedEventArgs e) { UndoRedoStack.Command command = new UndoRedoStack.Command(() => { DisplayPrograms(Category.WEB); }); undoRedo.AddAction(command); DisplayPrograms(Category.WEB); }