Where should I turn off a BusyIndicator in a custom control?

There is a Popup in the AutoCompleteBox. I want to make a busyindicator while the popup is being populated from the filtered ItemsSource items.
I've managed to alter the template.  And in the code, I locate the BusyIndicator and turn it on when the list starts to be filtered.
But if I make the BusyIndicator not busy again, it never shows up.  Because there was never an opportunity to draw it. It needs some time on the UI thread to have it update.
Anybody have a suggestion as to what method or event listener to hook into to set the busy at the beginning of the operation and unset it at the end?

If you're adding these things on the UI thread then isn't it going to be busy until you stop?
I know Silverlight doesn't have the fancy wait until idle setting you get in wpf but...
You might find if you do a begininvoke from your OnPopulating
YourControl.Dispatcher.BeginInvoke ...
It's queued until everything is done.
If you're lucky.
Failing that, consider just "cheating".
Work out roughly how long your populating is likely to take.
New up a storyboard for that timespan + 1 second or whatever.
Subscribe to the completed event and dispatcher.begininvoke in there.
Your UI will be busy by the time it fires and it'll probably queue OK but even if it doesn't then it'll be about right anyhow.
Storyboard sb = new Storyboard(); sb.Duration = new TimeSpan(0, 0, 1);
sb.Completed += new EventHandler(delegate(object s, EventArgs a)
// Dispatcher.Begininvoke....
sb.Begin();
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML

Similar Messages

  • Should I turn off my Mac Pro when not in use or leave it running?

    I have been told I should never turn off my computer by some people, and others say that I should always turn it off when not in use!  I use my Mac Pro primarily for music recording/editing in my home studio or word processing.  Now that I have an iPad I use that for web browsing, email, FBing, etc. and I find myself on my Mac Pro a lot less.  I get the basis behind both trains of thought; those who leave it on feel always stopping and starting up puts unnecessary wear on the moving disks, and those who shut down think if the parts are always moving they are bound to wear out faster.  I am not as concerned with conserving power as I am with keeping my machine safe!  If you have any information on this topic I would love to hear it. Thanks!

    Providing you have a robust firewal and are not worried as a result about being hacked then leave it turned on and allow it to sleep. Make sure you allow the screen to sleep as well a that is the item that is more prone to damage by being left on all the time.
    I never turn my machine off, never have with any of my Macs ever since my first one back in 1979-ish and have never suffered any adverse affects. Today, the power drain is so small when allowed to sleep that I doubt they would offend even the ardent 'turn off everything and pull out the plug to save the planet' person.
    If you have an iPad or iPod synced with the Mac for email and iCal and address Book etc. then if you leave it on it should be up to date as soon as you return home, mine is anyway. With iCloud coming out very soon that may come into play even more so with all its advance pushing etc. Just a thought.
    One advantage in leaving the machine on (sleep) is that you can access it from anywhere in the world should the need arise with the appropriate settings, which you can't if you turn it off.
    Leave it on.

  • Any time I open Safari i get a popup for myvdrive? why and how do I stop this? yes my safari preferences are checked that popups should be turned off.

    why and how do I stop this? yes my safari preferences are checked that popups should be turned off. Also it pops up any time that I click anywhere to do anything in safari. Please help.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you boot, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Should I turn off my computer when I go om vacation?

    should I turn off my desktop when I go on vacation, in the event ther is a thunderstorm?

    Yes, turn it off.  I also agree that computers should be turned off when you are "done" for the day.  I have aquantainces that do not ever turn them off.  Their computers never seem to last a long.  My last computer at the office lasted over six years and was fine until space on the HD and memory became an issue.  My last Home Computer was almost a teenager before it was replaced.  If fact I just recently gave away my old Packard-Bell computer (Windows 95) and it still worked!  I do still have my Heath-Zenith (Cost $ 3000.00 new! With Zenith-DOS.)  -Have a good vacation! 

  • Where can i turn off song repeat in music on my iPhone

    where can i turn off song repeat in music on my iPhone

    This is in the manual.
    Tap the screen while music is playing, then tap the repeat icon.
    iPhone User Guide (For iOS 5.1 Software)

  • Why should we turn off query cache when alternative UOM solution is used?

    Hi, all, Why should we turn off query cache when alternative UOM solution is used?I found it in "Checklist for Query Performance", but I dont know why.
    Please tell me if u know.
    PS: I also dont know how to turn off the cache, Need your help, thanks!

    hi ,
           I have also some confusion regarding Cache Parameters . What is the importance of cache ,  Should we delete the cache memory time to time for each query ? I have chked it in RSRT but never use the chache monitor function .

  • HT1430 how often should you turn off your ipad and iphone 4

    How often should I turn off my Iphone 4 and Ipad 2?

    Vanjan22 wrote:
    How often should I turn off my Iphone 4 and Ipad 2?
    As often or as rarely as you like.

  • Should you turn off your Ipod each time?

    Should you turn off your Ipod each time?

    See your other post on this Topic
    https://discussions.apple.com/message/24275152#24275152

  • Should you turn off the ipod each time?

    Should you turn off the Ipod each time you use it? Or how often?

    No, but you should turn it on if you are going to use it. It will turn itself off automatically after a few seconds of non-use.
    Please get iPod touch User Guide (For iOS 7 Software)Sep 18, 2013 - 21 MB.

  • Should I turn off my G5, or just let it sleep?

    I tried to search the forum for this question because I'm sure someone else has asked it, but had no luck. A couple of months ago my wife's G5 had a power supply failure, which also did enough other damage that the computer was not economically savable. I gave her my G5, and bought a new iMac (good deal for me!). The iMac instructions specifically say that it is better to just sleep the computer rather than turning it off on a daily basis, and to only turn the computer off when you are not planning on using it for awhile. Since the power supply on my wife's G5 blew on startup, I started to wonder whether leaving the G5 in sleep mode might not be a way to help keep the G5 alive longer. Much as I like my new iMac, I'd rather avoid the expense of doing another computer replacement if possible!
    So what is the best way to leave a G5 for the night? The machine is on for 10-15 hours/day, and is used for maybe half of that at most. During the day the G5 is allowed to sleep, and is turned off at night and re-started each morning. Am I better off treating it like the iMac and just sleeping it at night? Or are there other reasons to turn the G5 off that I don't know about?
    As always, thanks in advance for your input!

    Well, I'll provide another two cents worth of opinion.
    I put my G5 to sleep rather than shut it down because by leaving applications "running" during sleep, certain conveniences like remaining logged on to this discussion, for instance, accrue, and applications that are launched remain launched. Minor conveniences, but probably the reason that I allow the computer to sleep.
    The UPS comments are right on the mark. If the computer is sleeping when the mains power goes down, the UPS activity on USB will wake the computer and allow for an orderly shutdown, provided, of course, that the UPS is connected and the proper settings have been made in Energy Saver. This will even occur if a password is required on wake.
    As for stress on the system, I think it is a wash between sleep and cold-iron starts. Most subsystems are the equivalent of powered down during sleep, and there is a considerable power surge on wake as there is on a cold-iron start. Interestingly, when my last failed UPS was in its death throes, I had a couple of wake events where the power supply shut itself down almost immediately. I didn't make the connection until the UPS croaked a week later.
    Bottom line, it is moderately more convenient to allow the computer to sleep. The delta in hardware stress is trending towards zero, with probably a very slight advantage to sleeping. The power consumption issue (if there be one) favors turning the machine off. Basically, it all comes down to your personal preference. It's not like powering down a cluster of MicroVAXes and then waiting four or five hours for everything to come back up, so you can go either way and not see a whole lot of difference.

  • Broker commission notifications should be turned off.

    Hi All,
    There is a requirement that two Brokers (Rebate recipients) should not get any mail notifications i.e., once an output is triggered in billing(V3).
    These two are the  brokers assigned to function B1 and there is an output condition record maintained(External Send),
    If I remove the condition record then any of the broker assigned to partner function wont receive any mails but that is not the actual requirement. Only 2 brokers must be restricted from receiving any mail notifications.
    And I see there is no any email address maintained in the Customer Master of the Broker.
    Is there a config or master data change possible for this or a changes has to be made at the program level??
    Kindly suggest
    Regards,
    Manjunath

    Hi Phanikumar,
    Thanks for replying.Adding Customer to condition table and maintaining Condition record is the appropriate procedure to match the requirement I was asking I suppose.
    There was a slight change to the requirement after I posted this.
    When the broker wants the printed statements turned off, it means they want them sent via EDI instead. Initially this was not mentioned.
    So there should be a change in master data.

  • Should I turn off iTunes synch when I use iCloud to synch?

    I have been using iTunes to sync my iPhone  contacts and calendar to Outlook on my old Windows PC.  Now I've replaced the PC with a MacBook and have turned on iCloud on both my iPhone and Mac.  When I sync with iTunes now, I notice some calendar events are getting duplicated.  Is the best practice to just stop using iTunes and let iCloud handle all synching?

    Welcome to the Apple Community.
    iTunes synching should have been turned off when you started iCloud. Yes turn it off for appropriate services to avoid duplication.

  • Should we turn off IPT before letting it sleep ?

    Hi
    When IPT is not in use, should we manually turn the wifi off and then let IPT to sleep?
    I hope Apple is not so dumb, that they will let wifi on during sleep time. But i just want to confirm this from this forum.
    Thanks,
    Ramsundar

    wifi turns off after about 30 minutes of the ipod being in sleep mode.

  • HT2490 where do I turn off the POP UP BLOCKER

    How do I turn off the POP UP BLOCKER in Mac Pro?

    Safari 6
    Mountain Lion
    Safari > Preferences > Security
    Uncheck the box for "Block pop-up windows".
    Best.

  • Why should we turn off warning messages on queries?

    Hi, as we know, we always turn off warning messages on queries by RSRT, but I don't know why.
    Needs Help,Thanks all.

    hi,
    If you didnt surpress the messages in the RSRT,
    when user execute the report, on the top of the variable screen, and top of the report out put page the system will give warning messages, and usally Users dont like to see those messages and some of the users can think that there is some problem with the query designing;
    so always better to surpress the messages
    Regards
    ReddY A

Maybe you are looking for