Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8571079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:42:15+00:00 2026-06-11T18:42:15+00:00

I am creating an app where I am using MvvmCross on WP7 along with

  • 0

I am creating an app where I am using MvvmCross on WP7 along with a Bing Maps control. I am trying to bind the MapItemsControl ItemSource to an ObservableCollection of LocationDataSource, which contain a property MapPosition of the type GeoPoint. GeoPoint is a simple class which contain information about the Latitude and Longitude of the location.
The locations which I populate into the ObservableCollection are fetched by a service which my ViewModel listens to and updates the collection when it has fetched the locations. Though it does not seem to work as no locations are shown on the map.
To bind the GeoPoints I have made a converter which simply converts to GeoCoordinate which the MapItemsControl understands. I know the converter works as I am using it to bind to the Map Center property.

The binding looks like this:

<maps:MapItemsControl x:Name="mapControl" ItemsSource="{Binding Locations}">
    <maps:MapItemsControl.ItemTemplate>
        <DataTemplate>
            <maps:Pushpin Location="{Binding MapPosition, Converter={StaticResource GeoPoint}}" Template="{StaticResource pinSiteLoc}" />
        </DataTemplate>
    </maps:MapItemsControl.ItemTemplate>
</maps:MapItemsControl>

The ViewModel looks like this:

private ObservableCollection<LocationDataModel> _locations;
public ObservableCollection<LocationDataModel> Locations
{
    get { return _locations; } 
    set
    {
        _locations = value;
        FirePropertyChanged(() => Locations);
    }
}

I have tried various ways to update the Locations collection, which is done in the ViewModel in an event handler after the ViewModel has loaded and is ready, I assumed this would be working:

Locations = LocationDataService.Locations;

I have checked that LocationDataService.Locations is not empty and contains an actual location.
I also tried intantiating the collection the the ViewModel constructor and then add each element to the collection, which did not show anything on the map either.

EDIT
As per request in the comments. I have tried adding the locations like this to the collection, where it was instantiated as Locations = new ObservableCollection<LocationDataModel>(); in the ViewModel constructor. Then in the event handler it was populated as such:

private void LocationDataServiceOnLoadingChanged(object sender, EventArgs eventArgs)
{
    if (LocationDataService.IsInventoryLoaded)
    {
        foreach (var location in LocationDataService.Locations)
        {
            Locations.Add(location);
        }
    }
}

Can anyone see what I am doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:42:16+00:00Added an answer on June 11, 2026 at 6:42 pm

    As stated in the comment I made to the question, I found an error in the xaml file, where I prematurely closed the Map control tag like so:

    <maps:Map
        (..)
        />
    <maps:MapItemsControl x:Name="mapControl" ItemsSource="{Binding Locations}">
        <maps:MapItemsControl.ItemTemplate>
            <DataTemplate>
                <maps:Pushpin Location="{Binding MapPosition, Converter={StaticResource GeoPoint}}" Template="{StaticResource pinSiteLoc}" />
            </DataTemplate>
        </maps:MapItemsControl.ItemTemplate>
    </maps:MapItemsControl>
    

    Instead it had to be:

    <maps:Map
        (..)
        >
        <maps:MapItemsControl x:Name="mapControl" ItemsSource="{Binding Locations}">
            <maps:MapItemsControl.ItemTemplate>
                <DataTemplate>
                    <maps:Pushpin Location="{Binding MapPosition, Converter={StaticResource GeoPoint}}" Template="{StaticResource pinSiteLoc}" />
                </DataTemplate>
            </maps:MapItemsControl.ItemTemplate>
        </maps:MapItemsControl>
    </maps:Map>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a WPF app using the MVVM design pattern, and I'm trying to
I'm creating an iphone app using xcode 4.2, and trying to use the AVFoundation
I was trying to create an app using Bing Map. in which i need
I'm trying to creating a web app using GWT. In my application, I use
I'm creating a WPF TimeCard app using the MVVM design pattern, and I'm trying
I am creating an app using iOS 5 SDK. I managed to push views
I am creating an app using jQuery Mobile and PhoneGap. I delegate a button
I am creating an iPad app using XCode 4 and Storyboards. I have a
I am creating a WPF app using MVVM. The app manages tagged documents, called
I am creating a mobile app using jquery mobile, PHP using JSON for fetching

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.