1

This is a sort of extension of this question I asked yesterday (the question gave me a contentcontrol that can overlay the current control). I now have a contentcontrol that can be overlayed on the current control via bindings (a modal type window). This works well and I am happy with this. One great feature would be if I could get the overlay to go over its parent.

outline of display

currently the overlay will go into "My Control" control. What I would like is if I can still define it in that control (as that is were it is needed), but when it is displayed it can cover the whole main content area and / or the main window.

is this even possible?

Thanks

Community
  • 1
  • 1
Jon
  • 15,110
  • 28
  • 92
  • 132

2 Answers2

1

Sure it's possible, just wrap it into a Popup! :) You might have to manually stretch it though, but Popup is the control which will let you go outside the bounds of the parent view.

dain
  • 6,475
  • 1
  • 38
  • 47
  • would that not require a reasonable amount of code behind to deal with moving of the app / window to ensure they can not see the window / screen behind? – Jon Mar 28 '11 at 12:10
  • not necessarily, you can create a simple trigger to open your popup and the only extra thing you might have to do is to stretch the popup to full view – dain Mar 28 '11 at 12:59
  • when you say full view are you referring the whole monitor / screen or are you referring to the application? I.e. if the app is not maximized and I stretch the popup will it only take up the same amount of room as the application? If they move the application will it move with it? Thanks for the suggestions – Jon Mar 28 '11 at 15:54
  • by default the Popup won't be stretched, this needs some custom coding. the good side is that it entirely depends on you whether it's your LayoutRoot, any other layout element, or even something like Application.Current.RootVisual (if such thing exists in WPF, I use it in SilverLight) – dain Mar 28 '11 at 16:20
0

Another way is to host the MainContent in a grid and add a collapsed content control after the MainContent.

To show the popup: put it in the collapsed content control and make it visible. To hide the popup: collapse the contentn control and remove the popup.

Emond
  • 50,210
  • 11
  • 84
  • 115