views:

102

answers:

1

I'm currently using MVVMLight for my WP7 app and have found that the datacontext for an EventToCommand is always the page datacontext. I'm also using the phone.codeplex.com panorama control and had set the datacontext for each PanoramaItem to a different ViewModel but this datacontext is ignored and the page data context is used instead.

Anyone know why?

A: 

Hi,

This should not be the case. After working intensively for 2 weeks on a WP7 application with MVVM light, i can confirm that the DataContext should be set correctly. It is possible that

a) the CodePlex panorama control does something weird. That would be surprising but I cannot exclude it, having never used this control.

b) your DataContext has been overwritten somewhere in your DataTemplate. Blend does that sometimes. Make sure that this is not the case.

If the problem persists, send me a repro (small extract of the code where the problem is visible) and I will check it out.

Thanks, Laurent

LBugnion