Ppm
Ppm

Reputation: 162

switch tabs programmatically in xamDockManager

I have few tabs like Photo,Story,Graphics inside XamDockManager.I need to select a tab on the basis of shortcut key press like(ALT+CTRl+S for story).I am able to capture these shortcut key press event by using RoutedUICommand but i am kinda stucked at selecting the particular tab programatically.Please help me how can i achieve this.

Thanks in advance

Upvotes: 1

Views: 1313

Answers (2)

Ppm
Ppm

Reputation: 162

by calling Activate method of the ContentPane.

Upvotes: 2

SvenG
SvenG

Reputation: 5195

Give the TabControl a Name

<igWindows:XamTabControl x:Name="myTabControl">

And set the tab via SelectedItem in your code:

private void Window_KeyUp(object sender, KeyEventArgs e)
{
  //if ALT+CTRL+S...
  myTabControl.SelectedItem = myTabControl.Items[0];
}

Upvotes: 0

Related Questions