private void BtnDelAll_Click(object sender, RoutedEventArgs e) { var result = MessageBox.Show(_mainWindow, "真的要删除全部吗?", _mainWindow.Title, MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { _appDbOperator.ClearRecent(); UpdateList(); } }
public bool TryClearRecent() { try { _dbOperator.ClearRecent(); return(true); } catch (Exception ex) { Notification.Push($"Error while clearing recent: {ex.Message}"); return(false); } }