How to show a Wait Cursor when loading/writing data? RRS feed

  • Question

  • Hi all,

    I'm using Prism in my application so I have loosely coupled modules using an instance of a Data Service context. What I'd like is to have the mouse cursor change to a waiting cursor whenever data is transmitted and then back to an arrow when it is completed. Can anyone think of a nice way to do this without having to handle it in every single module seperately?

    I thought about setting a wait cursor in dataContext.SendingRequest and dataContext.WritingEntity and then back to arrow in dataContext.ReadingEntity but there are two issues with that. 1) ReadingEntity never follows WritingEntity so the cursor is stuck on waiting when updating data, 2) ReadingEntity is not fired when and exception occurs. Anyone else got a clever idea?



    Tuesday, August 31, 2010 9:56 AM

All replies

  • Hi

    Normally your UI should have a base class implemented which can handle these things. Either have a IsBusy property and based on this have the XAML react to the cursor stuff. In my project we have a status bar implemented - Red circle when communicating with the server, green when finished. So the base page does this heavy lifting and the XAML binds to that IsBusy property and a converter does the rest




    regards kashyapa
    Wednesday, August 24, 2011 7:40 PM
  • Have you thought about making your calls to the OData service asynchronously? That way, you can change the cursor when you begin execution and change it back in the callback. For more information, see Asynchronous Operations (WCF Data Services) and How to: Execute Asynchronous Data Service Queries (WCF Data Services).



    Glenn Gailey

    Please visit my blog

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, August 25, 2011 7:29 AM