Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems getting a collection of points to display with Nokia Maps
    primarykey
    data
    text
    <p>I am working with the Nokia Maps control in Windows Phone 8. Here is the code I have at present (relevant parts only)</p> <p>C#</p> <pre><code>public ObservableCollection&lt;LocationViewModel&gt; ItemLocations { get { return new ObservableCollection&lt;LocationViewModel&gt;() { new LocationViewModel() { Display = "MVVM Test", Location = new GeoCoordinate(43.07441, -88.25609) } }; } } </code></pre> <p>XAML:</p> <pre><code>&lt;maps:Map Center="{Binding MapCenter, Mode=TwoWay}" ZoomLevel="{Binding ZoomLevel}"&gt; &lt;maptk:MapExtensions.Children&gt; &lt;maptk:MapItemsControl ItemsSource="{Binding Path=ItemLocations}"&gt; &lt;maptk:MapItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;maptk:Pushpin GeoCoordinate="{Binding Location}" Content="{Binding Display}" /&gt; &lt;/DataTemplate&gt; &lt;/maptk:MapItemsControl.ItemTemplate&gt; &lt;/maptk:MapItemsControl&gt; &lt;/maptk:MapExtensions.Children&gt; &lt;/maps:Map&gt; </code></pre> <p>Right now, when the Map page loads, it centers on the correct location, however, no matter what I do with the ItemLocations list I get no points displayed on the Map. I went ahead and statically defined maptk:MapItemsControl.Items with some static points and it worked fine, it is only when I attempt binding (shown above) that it fails.</p> <p>The solution is utilizing Caliburn Micro for MVVM. As you can see with the sample above, I have hard coded the locations list in the ViewModel but <em>get</em> is never called, which is mysterious to me. If I only define PushPins as children to MapExtensions.Children it works.</p> <p>I am starting to wonder if ItemsSource is not bindable, but I feel that would be ridiculous. Help please</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload