Debugging XAML Binding with Silverlight 5

No.of Views2140
Bookmarked0 times
Downloads 
Votes0
By  Manas Patnaik   On  15 Apr 2011 09:04:22
Tag : Silver Light and XAML , Data Binding
For any data driven application with declarative data binding, with in XAML ,this brand new feature is the significant in many ways.Personally I remember most of the time i used to skip XAML way of binding as it lacked debugging feature.Now with Silverlight 5 my previous approach will surely take a back seat and will allow me to consider both ways equally.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

Well hope that you were aware of Silverlight 5 Beta release announcement today and its latest feature , if not make sure to have a look at my earlier post here. In this post we will discuss about XAML binding debugging ,a new feature available in Silverlight5 .Be sure that you read my last line carefully its XAML Data Binding debugging  not XAML debugging .

For any data driven application with declarative data binding, with in XAML ,this brand new feature is the significant in many ways.Personally I remember most of the time i used to skip XAML way of binding as it lacked debugging feature.Now with Silverlight 5 my previous approach will surely take a back seat and will allow me to consider both ways equally.

Prerequisites

Makes sure that you have downloaded latest version Silverlight Toolkit SDK .If not download from here .Also make sure that you are running on VisualStudio SP1.

The XAML Data binding

The example demonstrated here implement basic XAML data binding with DomainDataSource control , lets look at the XAML binding of one of the controls.

 

Image Loading

 Nothing fancy , simple binding.

The XAML Debugging

SETTING UP BREAKPOINT

As of now the XAML allows to apply breakpoint on Binding syntax only.Once break point applied ,it hits the breakpoint when ever push and pull triggered for that control.The image bellow shows the breakpoint with in XAML. 

Image Loading

 

The XAML editor will not allow you to set breakpoint anywhere else other than Binding syntax.

THE DEBUG INFORMATION

Once Breakpoint set start the application and wait for the compiler to hit it . 

Image Loading

 

You can find the debug information from Local tab

Image Loading

 

The information shows up a BindingState object holding complete binding context information of the control.as in above image , the BindingState value is UpdatingTarget so this way it shows that the binding is pushing data to control. 

Image Loading

 

Going deeper into the debugging information it shows complete picture on the nature of data and binding. 

Image Loading

 

Now another interesting fact , on TwoWay binding scenario once you change the data , for .e.g the FirstName control , 

Image Loading

 

the breakpoint again gets a hit as the binding source is getting updated .And the debug information shows the Binding state as Updating Source status. 

Image Loading

 

and the CurrentItem Information shows up the editing item detail and its properties. 

Image Loading 

Conclusion

Hope this post helps you to know the cool new feature of Silverlight5 , Try it Image Loading and extract information you need to know right from XAML.Keep commenting and keep your suggestions flowing.More to follow on Sillverlight5 Beta new features as i explore Image Loading

Source Code

Download source files -5692 kb

 
Sign Up to vote for this article
 
About Author
 
Manas Patnaik
Occupation-Software Engineer
Company-Infosys
Member Type-Fresh
Location-India
Joined date-10 Mar 2011
Home Page-www.manaspatnaik.com
Blog Page-www.manaspatnaik.com/blog
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top