/// <summary> /// Responds to click event in the context menu of the dataGrid with files. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FilesContextMenu_ClickDeleteOutput(object sender, RoutedEventArgs e) { FileStatsViewModel item = filesGrid.SelectedItem as FileStatsViewModel; if (item != null) { // Let the view model delete the report file. item.DeleteOutput(); } }
/// <summary> /// Responds to click event in the context menu of the dataGrid with files. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FilesContextMenu_ClickOpenFile(object sender, RoutedEventArgs e) { FileStatsViewModel item = filesGrid.SelectedItem as FileStatsViewModel; if (item != null) { // Let the view model open origin file. item.OpenFile(); } }
/// <summary> /// Responds to rowChanged event in the dataGrid with files. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FileRowChanged(object sender, SelectionChangedEventArgs e) { MainViewModel vm = (MainViewModel)base.DataContext; vm.FileRowIsAboutToChange(); DataGrid grid = (DataGrid)sender; FileStatsViewModel row = grid.SelectedItem as FileStatsViewModel; if (row != null) { // Let the viewModel update the list of words related to selected file. vm.ShowWords(row); } }