private void Button_Del_Click(object sender, RoutedEventArgs e) { var tag = (sender as Button).DataContext as TbHideWinEntry; TbHideWin.Del(tag); refreshGrid(); }
public MainWindow() { WindowStartupLocation = WindowStartupLocation.CenterScreen; InitializeComponent(); mListHotkey = TbHotkey.GetAll(); mListHideWin = TbHideWin.GetAll(); }
internal void Show(IWindowEntry win, Action onHideWinUpdate) { Show(); if (MessageBox.Show(String.Format("确定隐藏 \n程序名:{0}\n标题:{1} \n 窗口吗?", win.ProcessName, win.Title), "隐藏窗口", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { TbHideWin.Add(win); onHideWinUpdate(); Close(); } }
private void refreshGrid() { mList = TbHideWin.GetAll(); dataGrid1.ItemsSource = mList; }
private void OnHideWinUpdate() { mListHideWin = TbHideWin.GetAll(); }