by Corey via Xamlmammal.com on 12/8/2009 3:00:15 PM
So I typically do not blog much about WPF but recently I have been doing so much work in WPF I only thought it fair to share my experiences with it. Today I found out a little problem when I noticed that my Cursors defined in XAML was not working. In my little test application it was working fine, but when I applied the code to my solution they weren't working. After some research eventually I had an "AH HA!" moment. In code, a typical windows developer likes to add "Cursors.Wait" when doing calls to various services. And I noticed the code looked liked this:
Mouse.OverrideCursor = Cursors.Wait; //random synch process stuff Mouse.OverrideCursor = Cursors.Arrow;
The problem wasn't obvious here, but once the wait cursor is done with its task the mistake is setting the "Cursors.Arrow". The default value of "OverrideCursor" is actually null, not arrow. By forcing it to arrow means no other call can update the cursor but another Mouse.OverrideCursor. So to correct the issue your code should look like this:
Mouse.OverrideCursor = Cursors.Wait; //random synch process stuff Mouse.OverrideCursor = null;
Mouse.OverrideCursor = Cursors.Wait;
//random synch process stuff
Mouse.OverrideCursor = null;
Original Post: Careful using Mouse.OverrideCursor
The content of the postings is owned by the respective author. Silverlight Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on Silverlight Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.