private void Button_Del_Click(object sender, RoutedEventArgs e) { var tag = (sender as Button).DataContext as TbExecutablePathEntity; TbExecutablePath.Del(tag); refreshData(); mCallback(); }
private void ShowDialogAndUpdate(TbExecutablePathEntity entity, bool isCloseWin) { var dialog = new Microsoft.Win32.OpenFileDialog(); dialog.Filter = "exe file |*.exe"; dialog.InitialDirectory = entity.path; dialog.Title = entity.name + " 设置路径"; if (dialog.ShowDialog() == true) { entity.path = dialog.FileName; TbExecutablePath.UpdateOrAdd(entity); refreshData(); mCallback(); if (isCloseWin) { Close(); } } }
private void refreshData() { dataGrid1.ItemsSource = TbExecutablePath.GetAll(); }