Inogic is a hub of like minded professionals who believe in innovativeness and are committed to putting our time and efforts to R & D on Dynamics CRM.We endeavor to share some of our work on this blog by introducing Tips, Tricks and products from our labs.
Tuesday, June 25, 2013
How to show List Box Items Horizontally in CRM 2011 using Silverlight
Wednesday, February 22, 2012
How to debug XAML bindings in Silverlight 5
Prerequisites:
Silverlight 5 toolkit
Silverlight 5 Developer Runtime
Visual Studio 2010 SP1
The example demonstrated here implements basic XAML data binding. Below we have specified both the scenario when binding is correct and incorrect.
In below example we have given a simple binding for DataGrid.
When Binding is Correct:
Now you can apply a breakpoint to the binding syntax. Once the break point is applied, it hits the breakpoint whenever push and pull is triggered for that control. The below image shows the breakpoint applied within XAML
The XAML editor will not allow you to set breakpoint anywhere else other than Binding syntax.
Once Breakpoint is set, start debugging and wait for the compiler to hit the breakpoint.
You can find the debug information from Local tab.
The information shows up a BindingState object holding complete binding context information of the control. As in the above image, the BindingState value is UpdatingTarget so this way it shows that the binding is pushing data to control.
Going through the debugging information, it shows the complete picture on the nature of data and binding
Now another thing to know is, on TwoWay binding scenario once you change the data, 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. 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.
When Binding is Incorrect:
When binding is incorrect you will get the error while debugging the binding.
This will help you to find the incorrect bindings in your XAML.
Hope this helps you to get acquainted with the new feature of Silverlight 5