Binding

There are 3 entries for the tag Binding
DomainDataSource – Single Record Results

While the DomainDataSource is most often used for loading entire sets of records, it can also be used for loading a single record result.  This is a topic I’ve seen a few people talk about, assuming it’s a difficult thing to do, and even creating solutions for a problem that doesn’t exist.  I want to dispel the myth here: DomainDataSource can in fact be used to easily bind to a single record result. Let’s create a DomainService that has a method to get the most recent error from the AdventureWorks database: ...

posted @ Tuesday, November 10, 2009 10:33 AM | Feedback (2)

Binding Converters - VisibilityConverter

One of the reasons why the ViewModel pattern is so powerful in Silverlight and WPF is because Binding Converters can do so much.  As we saw in HelloWorld.ViewModel, a ViewModel can expose a boolean property that is consumed as a Visibility value for controls.  This requires some glue to convert the boolean to the necessary enum, and that’s where our VisibilityConverter comes in.  If you want to see this in action, go check out the sample code, but here’s how the VisibilityConverter works. In order to create any binding converter, you can start off by creating a class that...

posted @ Monday, October 27, 2008 9:58 PM | Feedback (1)

Binding to Nullable Values in XAML

I stumbled upon some behavior awhile back that struck me as odd.  I had a nullable property in my ViewModel that I was binding to in Silverlight, but I found that whenever the value was cleared out by the user, the property setter was not called. I narrowed it down to a simple application that has properties for Name and Age, as follows: 1: public string Name 2: { 3: ...

posted @ Wednesday, July 9, 2008 2:07 PM | Feedback (15)