public void AddCommand(string command) { if (command.Equals("Cancel")) this.lblCommandCancel.Visibility = System.Windows.Visibility.Visible; else { UIElement[] elements = new UIElement[this.pnlCommands.Children.Count]; pnlCommands.Children.CopyTo(elements, 0); if (elements.Any(element => element is Label && ((Label)element).Content == command)) { throw new InvalidOperationException("O comando já foi adicionado para a SpeechBar"); } Label newCommand = new Label(); newCommand.Content = command; newCommand.FontFamily = new FontFamily("Segoe UI Semibold"); newCommand.FontSize = 28; newCommand.Foreground = Brushes.White; newCommand.Margin = new Thickness(10, 25, 10, 0); this.pnlCommands.Children.Add(newCommand); } }