Note - this question may be similar to this thread
I have a Silverlight MVVM prototype project which uses Prism & the Rad docking framework, where each view is a RadPane. The interface is very similar to Blend & VS. In order to implement undo/redo functionality I need the application to track which view is currently in focus whenever a command is executed, so that each view's commands can only be undone/redone when that view has the focus.
The obvious solution of adding LostFocus/GotFocus event-handlers on the RadPane views doesn't work - if a control (e.g. a TreeViewItem) that is a child of the view/RadPane is clicked on, the GotFocus event doesn't 'bubble up' to the RadPane, even though it is part of the visual hierarchy, and therefore the application can't track where the focus is at the RadPane/view level. The only time these events get fired for the RadPane is when I click on the header tab for the RadPane.
Is there some obvious way of tracking the focus? Sorry if this is a stupid question!
I have a Silverlight MVVM prototype project which uses Prism & the Rad docking framework, where each view is a RadPane. The interface is very similar to Blend & VS. In order to implement undo/redo functionality I need the application to track which view is currently in focus whenever a command is executed, so that each view's commands can only be undone/redone when that view has the focus.
The obvious solution of adding LostFocus/GotFocus event-handlers on the RadPane views doesn't work - if a control (e.g. a TreeViewItem) that is a child of the view/RadPane is clicked on, the GotFocus event doesn't 'bubble up' to the RadPane, even though it is part of the visual hierarchy, and therefore the application can't track where the focus is at the RadPane/view level. The only time these events get fired for the RadPane is when I click on the header tab for the RadPane.
Is there some obvious way of tracking the focus? Sorry if this is a stupid question!
<
telerikDocking:RadDocking
x:Name
=
"radDockingHost"
Grid.Row
=
"2"
>
<
telerikDocking:RadDocking.DocumentHost
>
<
telerikDocking:RadSplitContainer
>
<
telerikDocking:RadPaneGroup
cal:RegionManager.RegionName
=
"TabbedDocumentsRegion"
>
</
telerikDocking:RadPaneGroup
>
</
telerikDocking:RadSplitContainer
>
</
telerikDocking:RadDocking.DocumentHost
>
<
telerikDocking:RadSplitContainer
InitialPosition
=
"DockedLeft"
>
<
telerikDocking:RadPaneGroup
cal:RegionManager.RegionName
=
"QuestionRegion"
>
</
telerikDocking:RadPaneGroup
>
</
telerikDocking:RadSplitContainer
>
<
telerikDocking:RadSplitContainer
InitialPosition
=
"DockedRight"
>
<
telerikDocking:RadPaneGroup
cal:RegionManager.RegionName
=
"PropertiesAndRoutingsRegion"
>
<
telerikDocking:RadPane
Header
=
"Routings"
/>-->
</
telerikDocking:RadPaneGroup
>
</
telerikDocking:RadSplitContainer
>
<
telerikDocking:RadSplitContainer
InitialPosition
=
"DockedBottom"
Height
=
"75"
>
<
telerikDocking:RadPaneGroup
>
<
telerikDocking:RadPane
Header
=
"Errors"
/>
</
telerikDocking:RadPaneGroup
>
</
telerikDocking:RadSplitContainer
>
</
telerikDocking:RadDocking
>