Calling method of Map control with Caliburn Micro and WP7

后端 未结 3 1978
余生分开走
余生分开走 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:32

    I did a lot of research on this particular thing and this question was helpful. Ultimately I ended up creating a Microsoft.Phone.Controls.Maps.Map Property on my ViewModel. All I had to do was set the x:Name property in the xaml to the Name of the Property that was the Map on the view model. Then I could easily update the map from the view model, and call SetView. You can easily alter the center of the map and change the zoom level just by changing those properties of the map, so you really only need to call SetView on initialization. I believe you can bind just about anything using the similar technique. The Map control is pretty awesome for an out of the box control, and plays very nicely with Caliburn.Micro.

提交回复
热议问题