In this post, I’ll show you how to create an extension method for the bool class that will simplify your .NET code in XAML-based apps (either WPF or Silverlight). In particular, this extension method addresses the fact that the Visibility property of UI controls in XAML is not a Boolean (true/false) value (as has traditionally been the case for both Windows Forms and ASP.NET). Instead, it’s one of three possible enumerated constant values: Hidden, Collapsed, and Visible.
Visible obviously means “visible,” while both Hidden and Collapsed mean “invisible.” The difference between Hidden and Collapsed is merely whether or not the invisible control occupies blank space on the screen that it would occupy if it were visible. Collapsed consumes no space, while Hidden does.
It’s nice to have the three options, but in most cases you’ll find that you just need the two…
I know this post is overdue, but I’m happy to say that in the time since MIX has elapsed, my wife and I have sold our condo and moved to a new home. I’ve also transition to a new contract, and I am excited to get my feet wet my new project. Despite the delay, it was a wonderful experience. This was my first year at MIX. The content, announcements, and the networking were all memorable. I only wish I could’ve attended all the sessions. Luckily the content is available online, so I did my best to mark key talks that I wanted to catch back home.
This year was filled with a number of announcements at the two keynotes I did my best to update my twitter feed with some of the cool ones.
The first keynote was focused around recent…
Downloade the Presentation and Code
The Connecticut User Group organized a full day code camp event in Bloomfield, CT. The topic I presented on was “RESTFul Services and Silverlight”. The presentation was organized around the following main topics:
Web Services via SOAP
Creating a WCF RESTFul Service
Consuming a Custom WCF RESTFul Service in Silverlight
The attached slide deck will provide you with highlights on each topic. The code samples revolve around the AdventureWorks Database. I have partitioned the code into Data Access, Service Layer and a UI Layer.
Database: AdventureWorksDB from code plex. You can download it from here: http://www.codeplex.com/MSFTDBProdSamples
Data Access: Used Nettiers and Codesmith to Generate the CRUD methods to access Adventure Works.
Service Layer: WCF, ASMX and WCF REST service examples. I have also included a sample service from John Papa’s Data Services with Silverlight book. I would recommend this book for who ever is…