Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - HOW TO DO? View refresh in WPF form?!?!

Reply
 
Old 09-14-2008   #1 (permalink)
Dmitry Bond.


 
 

HOW TO DO? View refresh in WPF form?!?!

Hi.

I need quite a simple thing - when user changed selection in ComboBox
I need to put semi-transparent RECTANGLE over the whole form with the
"Connecting service..." text. Thus, user see that something in pogress
and form controls are unavailable.

The first idea I got was - put Rectangle + Label on a form, mark them
as Visibility=Hidden, then in "cmbServer_SelectionChanged" event
handler execute code like this:

rectProgress.Visibility = Visibility.Visible;
labProgressText.Content = string.Format("Trying server {0}
({1}) ...", pSrvName, url);
try
{
// ... operation takes about 3 - 10 seconds ...
}
finally
{
rectProgress.Visibility = Visibility.Hidden;
}

But it does not work - Rectangle does not appears at all.
Could you please advice - what is wrong and what can I do to make it
working?

Regards,
Dmitry.

My System SpecsSystem Spec
Old 09-14-2008   #2 (permalink)
Alun Harford


 
 

Re: HOW TO DO? View refresh in WPF form?!?!

Dmitry Bond. wrote:
Quote:

> Hi.
>
> I need quite a simple thing - when user changed selection in ComboBox
> I need to put semi-transparent RECTANGLE over the whole form with the
> "Connecting service..." text. Thus, user see that something in pogress
> and form controls are unavailable.
>
> The first idea I got was - put Rectangle + Label on a form, mark them
> as Visibility=Hidden, then in "cmbServer_SelectionChanged" event
> handler execute code like this:
>
> rectProgress.Visibility = Visibility.Visible;
> labProgressText.Content = string.Format("Trying server {0}
> ({1}) ...", pSrvName, url);
> try
> {
> // ... operation takes about 3 - 10 seconds ...
> }
> finally
> {
> rectProgress.Visibility = Visibility.Hidden;
> }
>
> But it does not work - Rectangle does not appears at all.
> Could you please advice - what is wrong and what can I do to make it
> working?
You're doing a long-running synchronous operation in the UI thread.

See: http://msdn.microsoft.com/en-us/library/ms741870.aspx

for more information

Alun Harford
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
MS Outlook info. - The form required to view this message cannot be displayed. Microsoft Office
Folder does not refresh after disbaling auto arrange in list or detail view Vista file management
Classic View Control Panel Won't Stay as Default View Vista General
Classic View in Windows vista - how do I get the 3-D view back Vista General
Get-Format/Get-View command to return views, view defs? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46