change image of pinpoint in real time

4 posts, 1 answers
  1. Yb
    Yb avatar
    3 posts
    Member since:
    Dec 2013

    Posted 04 Dec 2013 Link to this post

        Hello everyone, now I have put some pinpoints on the map(behind there are some custom objects named target), and I want the image of pinpoint to change  dynamically when some events occur, what should I do? Should I Use INotifyPropertyChanged or ObservableCollection (maybe this will not work because map will not refresh when image source property change)? Or should I not use pinpoint and instead use custom item directly?
        What's the best way to organize the items on map that can reflect the change of property(image) in real time? Thank you every much and wait for help! (Better If there are some sample codes)
  2. Yb
    Yb avatar
    3 posts
    Member since:
    Dec 2013

    Posted 04 Dec 2013 Link to this post

      It' not easy to change image source property of pinpoint which is already on map.For property like location, we can simply use       MapLayer.SetLocation() to update its status without more efforts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 05 Dec 2013 Link to this post

    Hi Yb,

    I think the best approach to do it is using MVVM. You can bind your data item collection to the VisualizationLayer.ItemsSource property. And you can specify the appearance of the point via DataTemplate using the ItemTemplate property. Also you should implement the INotifyPropertyChanged interface in your data item class to allow to change the source of the Image using data binding.

    I have attached a sample solution which implements this approach.

    I hope it helps.

    Regards,
    Andrey Murzov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

    Sign up for Free application insights >>
  5. Yb
    Yb avatar
    3 posts
    Member since:
    Dec 2013

    Posted 05 Dec 2013 Link to this post

    Hi, Andrey
    Thank you very much! That's actually what I want! May you best wish.
Back to Top