Click here to Skip to main content
15,923,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to set the ToolBarItem enabled property with isFocused property value of Content pane.

I have done as below.
It’s not working as expected. The toolbarItem remains disabled all the time.
Could you please help.



XML
<igDock:ContentPane Header="Dashboard" x:Name="dashboardWindow" AllowClose="False" FocusManager.IsFocusScope="True">
                                   <ContentControl Content="{Binding ElementName=panelUI, Path=DashboardControl, Mode=TwoWay}" />
                                   <ContentControl.ContextMenu>
                                       <ContextMenu>
                                           <MenuItem  Header="Add New Tile" Command="{Binding AddTileContextMenuCommand}"></MenuItem>
                                       </ContextMenu>
                                   </ContentControl.ContextMenu>
                               </igDock:ContentPane>



<controls:toolbaritem x:name="AddTileItem" header="STAT_DASHBOARD_ADD_TILE" tooltip="STAT_DASHBOARD_ADD_TILE_TOOLTIP" isenabled="{Binding ElementName=dashboardWindow,Path=IsFocused,Mode=OneWay}" xmlns:x="#unknown" xmlns:controls="#unknown">
Posted

1 solution

Below is just a Sample Code Snippet.

You need to bind your isFocused Property of your ContentPane to isEnabled Proeperty of ToolbarItem.
By this was,
If ContentPane is Focused then ToolbarItem will be enabled.

<stackpanel>
    <contentpane x:name="contentPane" content="Toggle" xmlns:x="#unknown" />
    <toolbaritem>
       isEnabled"{Binding isFocused , ElementName=contentPane/>
</toolbaritem></stackpanel>
 
Share this answer
 
Comments
Sreepada1005 29-Nov-13 9:08am    
Thanks Anthony.It helped. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900