protected override void OnNavigatedFrom(NavigationEventArgs e) { // Destroy the graph if the page is naviated away from if (graph != null) { graph.Dispose(); } }