private void CommandNew(object sender, ExecutedRoutedEventArgs e) { if (this.currentTabIndex >= 0) { tab[this.currentTabIndex].Title.Opacity = 0.5; tab[this.currentTabIndex].TextEditor.Visibility = Visibility.Hidden; } this.AddNewTab(); this.currentTabIndex = tab.Count - 1; tab[this.currentTabIndex].TextEditor.Focus(); }