tags:

views:

293

answers:

2

Hi,

I've got a window which opens a borderless dialog where you select some options. Once the options are set the dialog closes and the main window is enabled again. Not too difficult.

But due to the changed options in the option screen I need to refresh the main window and prevent changes from beeing made before the refresh.

So now I'd like to add and extra layer with a progressbar in the middle to notify the user: please wait, we are refreshing.

What would be the best practices around this?

+4  A: 

You could take a look at Adorners (MSDN link) which allows you to stick a rendering surface on top of other UI Elements. That would allow your existing controls to be ignorant of the refreshing stage and allow incapsulation of the progress-visualization inside the Adorner and the chunk of code that is required to show/hide the Adorner layer

soren.enemaerke
Thanks, I'll try it.
Snake
Great. That works perfectly!
Snake
A: 

I just learned about the Popup primitive control. It isn't modal, but it does overlay other controls on the screen.

You could, hypothetically, open a popup that covers the entire window (you'll have to move it if the user moves the window) that has a transparent background with an opaque centered panel that displays your wait message. Add a tinted transparent background to the popup for a dimmed UI experience.

Will
I've done this tinted thing with a border named "Shadow" Background="Black" Opacity="0.36" Visibility="Hidden". I found this in the code samples for "Pro WPF with VB 2008" by Matthew MacDonald.
Anthony Potts
It is not possible to create a full screen popup window as described in an answer to this question:http://stackoverflow.com/questions/2633129/cant-create-a-fullscreen-wpf-popup
Ashley Davis