Recommended

Skip Navigation LinksHome / News / View News

Throttling Silverlight Mouse Events to Keep the UI Responsive

+ Add to SilverlightShow Favorites
0 comments   /   posted by Silverlight Show on Jun 15, 2010
(0 votes)
Tags: Mouse Events , Events , WPF , Colin Eberhardt
Colin Eberhardt describes a technique for ‘throttling’ mouse events to ensure that each time an event occurs, the UI has the opportunity to render.

The visual tree of a Silverlight / WPF uses the retained mode graphics  rendering style, where the tree forms a model of the graphics which are rendered to the screen. Any changes that are made to the visual tree by adding / removing objects or changing the properties of an object within the tree, are automatically rendered to your computer screen at some point in the future.

This graphics style makes the development of complex graphics far easier than with the immediate mode counterpart. You add objects, make changes to them, and these changes are reflect on the screen by some background magic. This works just fine most of the time, however, if you continually make changes to the visual tree, without yielding, the ‘process’ which updates the UI does not have the opportunity to run, and your UI is starved.

Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 8 and 6 and type the answer here:

Join the free SilverlightShow webinar 'Silverlight's Power Features: Data Binding in Action' on August 19th 2010, 10:00 am PDT.
In this session Gill Cleeren will make with a complete overview of the data binding features Silverlight 4 has to offer. He will discuss how data binding is the enabler for applying the MVVM pattern and commanding, and will end up reviewing Blend's support for data binding, including the use of design-time data. Read more | Register Now (hide this)