private void CloseCommand_Execute() { if (this.CloseCurrentTabComand != null) { CloseCurrentTabComand.Execute(); return; } if (this.SelectedIndex >= 0) { this.Items.RemoveAt(this.SelectedIndex); } }
private bool CloseCommand_CanExecute() { if (this.CloseCurrentTabComand != null) { return(CloseCurrentTabComand.CanExecute()); } if (this.SelectedIndex >= 0 && this.SelectedItem != null) { if (this.SelectedItem is TabItem) { return(true); } } return(false); }