This project has moved and is read-only. For the latest updates, please go here.


Design Data Issue in MVVM Light V4b1 for Windows 8 Consumer Preview


I develop a win 8 app. This is I noticed that the design data be not displayed. I've attached a demo project to demonstrate the behavior. I could reproduce the behavior several times.

Issue 1:
  1. Open DesignDataIssue Project with VS 11
  2. If not, then open SettingPage.xaml design view -> PageTitle: "Setting Title" is visible
  3. Build Solution -> PageTitle is no longer visible and Error "Object does not match target type." is displayed (DataContext="{Binding Setting, Source={StaticResource Locator}}")
  4. Close and reopen SettingPage.xaml -> PageTitle: "Setting Title" is again visible
  5. Rebuild Solution -> PageTitle: "Setting Title" remains visible
Issue 2:
  1. Open SettingViewModel.cs and comment out the constructor "public SettingViewModel(INavigationService navigationService, ISettingService settingService)". Uncomment the constructor with resourceservice argument "public SettingViewModel(INavigationService navigationService, ISettingService settingService, IResourceService resourceService)"
  2. Build Solution -> PageTitle is not visible and Error "Das Gerät ist nicht bereit. (Exception from HRESULT: 0x80070015)" is displayed (DataContext="{Binding Setting, Source={StaticResource Locator}}")
  3. No Solution found!

file attachments

Closed Oct 21, 2012 at 10:39 PM by lbugnion
Never got a reply if that reproes in Win8 RP or RTM. Probably fixed.


lbugnion wrote Jul 18, 2012 at 2:20 PM


Do you have the issue in Windows 8 RP still? If yes, please update the sample and I will look at it. Right now I am getting quite a lot of errors when trying to port the sample to Win8 RP.


roschler wrote Feb 15, 2014 at 6:03 PM

Was there ever a fix for this? I have multiple projects that are being affected by it. I'm running VS2013, Windows 8.1.

roschler wrote Feb 15, 2014 at 6:55 PM

This is not a fix but I'm putting it here in case it helps anyone. Moving the DataContext assignment out of a resources child XML element to an attribute of the Page element seems to have helped. In other words, I changed from this:

<Binding Mode="OneWay" Path="Main" Source="{StaticResource Locator}"/>

To this:

DataContext="{Binding Mode=OneWay, Path=Main, Source={StaticResource Locator}}" 
And I could see my design data, no longer got the consistency check Exception in the design editor, and no longer got the compiler warning "object type does not match target type". I have no idea why this helps.