How to find top window in Deckworkspace

Topics: CAB & Smart Client Software Factory
Dec 24, 2006 at 12:52 PM
originally posted by: BodoProbst

I have a deck workspace application with several modules covering diffent use cases. A single module may consist of several views that may pile up in the deck.

The question is: How can a view determine if it is currently on top / displayed or hidden behind another view?
Dec 24, 2006 at 2:28 PM
originally posted by: JuanArg

You may ask the Workspace if that View is the ActiveSmartPart.
To find the Workspace in which the view is shown you can use the IWorkspaceLocatorService from the Workitem.
This is an example placed at the presenter of a given View.

Hope it help you.

IWorkspaceLocatorService locator = WorkItem.Services.Get<IWorkspaceLocatorService>();
IWorkspace workspace = locator.FindContainingWorkspace(WorkItem, View);

return (workspace.ActiveSmartPart == View);

Juan Arguello