Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
Menu within ContentPane captures mouse when pane is activated
posted

If I put a menu into the _quadpane content pane like so:

 

 

 

 

 

 

 

 

 

 

 

 

<igDock:ContentPane x:Name="_quadpane">

 

 

 

 

<StackPanel>

 

 

 

 

<Menu>

 

 

 

 

<MenuItem Header="Load" />

 

 

 

 

<MenuItem Header="Close" />

 

 

 

 

</Menu>

 

 

 

 

<Grid Width="500" Height="500"></Grid>

 

 

 

 

</StackPanel>

 

 

 

 

</igDock:ContentPane>

After I click on that pane, only the menu will receive  mouse clicks. The rest of the app will no longer get mouse clicks. It doesn't matter where I click, they're not recognized. Any ideas?

Thanks,

Dave

  • 54937
    Offline posted

    In the future please post new questions as a separate thread to make it easier for other to search for answers and to not reopen a thread about a different matter.

    With regards to your question when a ContentPane is activated it shifts focus to the first focusable child. The way that you have your xaml setup, the Menu is in the tab order and so WPF will include that when searching for the first focusable child. When the WPF Menu gets focus it goes into "menu mode" and while in that mode it captures the mouse. So you need to prevent the Menu from being in the tab order by putting the menu into an element whose TabNavigation is None. e.g.

    <igDock:ContentPane x:Name="_quadpane"> 
      <StackPanel>
        <Grid x:Name="menuContainer" KeyboardNavigation.TabNavigation="None">
          <Menu>
            <MenuItem Header="Load" />
            <MenuItem Header="Close" />
          </Menu> 
        </Grid>
        <Grid Width="500" Height="500">
        </Grid>
      </StackPanel>
    </igDock:ContentPane>