This is a migrated thread and some comments may be shown as answers.

Command Binding and focus problem

1 Answer 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 27 Jan 2013, 03:59 PM
Hello,

I have a problem with WPF Command and I need some Help.
I defined some static RoutedCommand in my App class. My main window is composed of a RadRibbonView and a RadTabControl.
I Populate the TabControl with some classes that inherit from RadTabItem.
 Buttons in the ribbon are bound to my RoutedCommand and I add commandbindings bound to the commands In my RadTabItem children classes.
My TabItem has the Content property set to a UserControl.The buttons works fine while the TabItem header has the focus but if I click on the content of the TabItem (my UC), the button stop calling the CanExecute and Executed callbacks of my TabItem.
I Want the selected TabItem always manage the CanExecute and Execute call for all commands.

How can i handle this ?

Thank you,

1 Answer, 1 is accepted

Sort by
0
Benjamin
Top achievements
Rank 1
answered on 28 Jan 2013, 07:22 PM
Hello,

I found a workaround, instead of adding CommandBindings in my TabItem, I do this in my window and call methods of my TabItem.
I'm steal interested for a solution to add CommandBindings in my TabItem.

Thanks
Tags
General Discussions
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Benjamin
Top achievements
Rank 1
Share this question
or