ItemsSource binding at design time using naming conventions

Topics: Conventions, Getting Started
May 2, 2013 at 11:21 PM

I'm new to CM and really appreciate all the work you guys have done on it. I'm really enjoying it.

I'm trying to get DesignTime bindings to work in a WP8 app. I have created a design time ViewModel which I specify explicitly in the PhoneApplicationPage:
    d:DataContext="{Binding Source={d:DesignInstance Type=designTime:StartPageDesignTimeViewModel, IsDesignTimeCreatable=True}}"
The page is really just a RadDataBoundListBox from Telerik:
<Grid x:Name="ContentPanel">
    <telerikPrimitives:RadDataBoundListBox x:Name="Rooms"  ...>
As you can see, my ViewModel (and design time view model) have a public property named Rooms which I am binding to the ItemsSource collection using the named convention approach. The approach doesn't work at design time, however, unless I add the ItemsSource property
<Grid x:Name="ContentPanel">
    <telerikPrimitives:RadDataBoundListBox x:Name="Rooms" ItemsSource="{Binding Rooms}" ...>
Is there a way to get my bindings to work at design time using the naming conventions approach without modifying the page with anything other than design time attributes?

May 3, 2013 at 7:00 AM
I asked this same question on Stack Overflow and ended up figuring it out and answering myself:

I figured out that what I was after was the ability to force CM to replace declared bindings which it won't do by built-in convention