Command Binding and focus problem

2 posts, 0 answers
  1. Benjamin
    Benjamin avatar
    24 posts
    Member since:
    Dec 2012

    Posted 27 Jan 2013 Link to this post

    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,
  2. Benjamin
    Benjamin avatar
    24 posts
    Member since:
    Dec 2012

    Posted 28 Jan 2013 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top