private async void Graph_Confirm_Create(object sender, RoutedEventArgs e) { try { if (Graph_exist) { msgdi = new MessageDialog("Não pode existir mais de um Grafo ainda!"); await msgdi.ShowAsync(); return; } else { Graph = new Grafo(isDigraph.IsOn); Graph.name = label_box_graph.Text; Graph_exist = true; GraphCreate.Visibility = Visibility.Collapsed; myConsole.AddStringToConsole($"\nGrafo {label_box_graph.Text} foi adicionado."); myConsole.Update(); Add_Graph.Visibility = Visibility.Collapsed; } } catch (Exception ex) { msgdi = new MessageDialog($"Erro: {ex.Message}"); await msgdi.ShowAsync(); } label_box_graph.Text = ""; }
/// <summary> /// Updates info from Graph /// </summary> void Update_graph_info() { if (Graph_exist) { Grafo_stats.Text = Graph.ToString(); } else { Grafo_stats.Text = "Grafo ainda não existe!"; } myConsole.Update(); }