Wednesday, April 14, 2010

Silverlight Debugging XAML

Well I found it hard the other day to try and debug the XAML Parser. I was having an issue in Silverlight 2 and databinding. I came accross several posts and have heard from Microsoft that we cannot debug the XAML Parser. I needed to see the values of what was rendered XAML.

It almost seemed impossible until I came accross a great tool by First Floor Software called Silverlight Spy.

All I can say is that this tool saved me and is something that will remain in my toolkit forever:

Fully functional for thrity days and less than 200$, well worth it.

Getting a child element in Silverlight - Simple solution

I needed to get a child element of my layout root. I knew the index, but most examples out there were so confusing and way too involved for something that seemed so easy. This reminded me of a comment from a developer at Microsoft:

"If it seems too hard or way too much code, you must doing it wrong" - Trevor Fellman

You what, great advice, it turns out I found the following examples:

Get Child, Parent, or Children Objects in Silverlight:

Great advice, if I didn't know the index of the object, yet I do, (Silverlight Spy is your friend)

Then I came across this:

LINQ to Visual Tree

very neat stuff and I see myself using this in the future, but too involved for what I needed to do.

I then found this:

VisualTreeHelper Class

Not this had me thinking, how can I simply call this and get my object in c# all in one simple line of code, and here is what I came up with:
ImageScroll myimagescroll;
myimagescroll = (VisualTreeHelper.GetChild(this.LayoutRoot, 7) as ImageScroll);
What this line does is exactly what i was looking for. My object IMAGESCROLL, which is index #7 in the collection(children) of the Layoutroot Grid Object.

Sunday, April 11, 2010

Visual Studio 2010 Launch Tomorrow April 12th

Cannot wait, Loving what I am hearing about the new Silverlight switching. No more batch file yay. If you want to watch the launch you can watch it here:

Notes from page:

The topics will range from all the new, great features in Visual Studio 2010 to Silverlight, WPF, WF, WCF, Application Lifecycle Management, .NET 4.0, ASP.NET 4.0 AJAX, ASP.NET MVC and much more!

And remember: If you sign up for Microsoft Visual Studio Conference & Expo, you'll automatically get access to both the ASP.NET and Silverlight and the SQL Conference and Expo! That's a Visual Studio launch and three conferences for the price of one!

In addition to insightful keynotes by Bob Muglia, President, Server and Tools Business and Scott Guthrie, Corporate Vice President, .NET Developer Platform, see key members of the Visual Studio team including Doug Seven, Sean McBreen, Chris Sells and Andy Conrad. Also see favorites from the third-party community including Juval Lowy, Michele Leroux Bustamante, Billy Hollis, Tim Huckaby, Rocky Lhotka, Dan Wahlin, Steven Smith, and Rick Strahl. Listen to a live recording of .NET Rocks! with Carl Franklin and Richard Campbell.

If you compare the number of expert speakers and in-depth sessions we offer to other conference events, you'll realize that this is the best value out there! And the Bellagio Resort is the perfect set of surroundings for our event.

Here is the launch Schedule: