Calling method of Map control with Caliburn Micro and WP7

后端 未结 3 2066
余生分开走
余生分开走 2021-01-16 23:50

I have a page (view) in my Windows Phone 7 application that uses the Silverlight Map control.

I need to call the SetView method on the control, but I\'d like to stic

3条回答
  •  不要未来只要你来
    2021-01-17 00:21

    I've done this by having a MapLocation property on the view model, and then hooking up to the view model's PropertyChanged event in the view. When the property is the MapLocation property, I just call SetView and pass in the value of the ViewModel's MapLocation property.

    I know it's not "strictly" MVVM, but what we're talking about here is something that is view specific, but can't be bound to. The event aggregator approach as Rob suggests is another good option, but seems like overkill in this scenario. I'm all for going with whatever works well and with good performance for the user :)

提交回复
热议问题