Hello,
I have an MVVM application.
In this application I use RadMap control with search engine via BingSearchProvider class.
If I binding result of work BingSearchProvider as ObservableCollection<Location> all works perfectly,
but if I try to wrap result in MyMapItem and try binding ObservableCollection <MyMapItem>
the map refuses to display search result positions on InformationLayer.
How i can solve this problem? How i can use custom class for display position on Radmap control? I don't want use buffer object list =(
Here is located the simple project which demonstrate a problem
I have an MVVM application.
In this application I use RadMap control with search engine via BingSearchProvider class.
If I binding result of work BingSearchProvider as ObservableCollection<Location> all works perfectly,
| <telerik:InformationLayer x:Name="informationLayer" |
| ItemsSource="{Binding Path=LocationData.SearchResult}"> |
| <telerik:InformationLayer.ItemTemplate> |
| .... |
| public ObservableCollection<Location> SearchResult { get; private set; } |
| private void geoHelper_SearchCompleted(object sender, LocSearchCompletedEventArgs e) |
| { |
| SearchResult.Clear(); |
| var searchResult = e.Locations as ObservableCollection<MyMapItem>; |
| foreach(MyMapItem loc in searchResult) |
| SearchResult.Add(loc.Location); |
| } |
but if I try to wrap result in MyMapItem and try binding ObservableCollection <MyMapItem>
the map refuses to display search result positions on InformationLayer.
| <telerik:InformationLayer x:Name="informationLayer" |
| ItemsSource="{Binding Path=LocationData.SearchResult.Location}"> |
| <telerik:InformationLayer.ItemTemplate> |
| .... |
| public class MyMapItem |
| { |
| public Location Location |
| { |
| get; |
| set; |
| } |
| public string Title |
| { |
| get; |
| set; |
| } |
| public string Description |
| { |
| get; |
| set; |
| } |
| } |
| public ObservableCollection<MyMapItem> SearchResult { get; private set; } |
| private void geoHelper_SearchCompleted(object sender, LocSearchCompletedEventArgs e) |
| { |
| SearchResult.Clear(); |
| var searchResult = e.Locations as ObservableCollection<MyMapItem>; |
| foreach(MyMapItem loc in searchResult) |
| SearchResult.Add(loc); |
| } |
How i can solve this problem? How i can use custom class for display position on Radmap control? I don't want use buffer object list =(
Here is located the simple project which demonstrate a problem