.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> Silverlight >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Debugging XAML Binding with Silverlight 5

Posted By:Manas Patnaik       Posted Date: April 13, 2011    Points: 200    Category: Silverlight    URL: http://www.dotnetspark.com  

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. 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 .
 

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.

Silverlight5 XAML Debugging

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 triggeredfor that control.The image bellow shows the breakpoint with in XAML.

Silverlight5 XAML Debugging

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 .

Silverlight5 XAML Debugging

You can find the debug information from Local tab.

Silverlight5 XAML Debugging

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

Silverlight5 XAML Debugging

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

Silverlight5 XAML Debugging

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

Silverlight5 XAML Debugging

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

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

Silverlight5 XAML Debugging

Conclusion

Hope this post helps you to know the cool new feature of Silverlight5 , Try it Thumbs up 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 Be right back.

Source Code

Download Source Code - Silverlight5_XAMLDebug.zip


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend