Performance UI Pattern: Asynchronous Property

Motivation: XAML development thrives on declarative data binding. The means that at author-time a unique path to each piece of data to be displayed is known. At runtime when the data binding is interpreted a property is called to retrieve the data. This retrieval may take time causing a delay for each visual element in a displayed user interface.

Anti-pattern 1: Data is loaded then it is presented to the UI. In this anti-pattern the developer often loads more content than needed for the currently visible user interface. This causes more delay before the UI is fully presented.

Anti-pattern 2: On-demand loading of properties (Lazy Initialization Pattern) as they are presented in UI. In this anti-pattern the data the retrieved when it is first requested. This property get blocks until the property data is ready.

Asynchronous Property Pattern: This pattern allows for on-demand request of the property which instantly returns an object which represents the property which will be populated once the load is completed. The asynchronous property provides properties for value and status. Because the asynchronous property is retrieved installs, data binding to both the value and the status.

AsyncProperty demonstration Windows Phone 7 application download here:

http://cid-ac1291870308f748.skydrive.live.com/embedicon.aspx/Public/AsyncPropertyDemo.zip

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment