private void btnClearHistory_Click(object sender, RoutedEventArgs e) { myHistory = new HistoryViewModel(); try { myHistory.clearHistory(); messageBox("History has been cleared"); this.Frame.Navigate(typeof(HistoryPage)); } catch (Exception ex) { messageBox("error " + ex.Message); } }