FocusManager.FocusedElement="{Binding ElementName=radMap1}"private void UserControl_Loaded(object sender, RoutedEventArgs e) { radMap1.Focusable = true; radMap1.Focus(); }PrivateSubLoadKMLData()DimstreamResourceAsStreamResourceInfo = Application.GetResourceStream(NewUri("pack://application:,,,/Map_Test;Resources/doc.kml", UriKind.RelativeOrAbsolute))DimelementsAsList(Of FrameworkElement) = KmlReader.Read(streamResource.Stream)ForEachelementAsFrameworkElementInelementsMe.informationLayer.Items.Add(element)NextelementEndSub
Also tried this with no luck either. Gives me a "Cannot locate resouce 'doc.kml':
DimstreamResourceAsStreamResourceInfo = Application.GetResourceStream(NewUri("/Map_Test;component/Resources/doc.kml", UriKind.RelativeOrAbsolute))' Dim streamResource As StreamResourceInfo = Application.GetResourceStream(New Uri("doc.kml", UriKind.RelativeOrAbsolute))DimelementsAsList(Of FrameworkElement) = KmlReader.Read(streamResource.Stream)ForEachelementAsFrameworkElementInelementsMe.informationLayer.Items.Add(element)Nextelement
I have a problem using InformationLayer.GetItemsInLocation(Location);
My InformationLayer is binded to an ObservableCollection<MyClass> myObjektCollection
<Map:InformationLayer Name="myObjektLayer" ItemsSource="{Binding myObjektCollection }" ItemTemplate="{StaticResource informationLayerFlyttObjektTemplate}" Visibility="Visible" />
While adding MyClass items to myObjektCollection , I can see that both InformationLayer(myObjektLayer) and myObjektCollection increases.
If I ,just after adding a new MyClass item to myObjektCollection, try to call
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation); returns no items found.
If I later, after refreshing the map call the same method InformationLayer(myObjektLayer).GetItemsInLocation(myLocation); returns with expected items.
I know that myLocation is valid.
Ex.
myObjektItemCollection.Add(myClass);
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation) - No result
In method MapMoved()
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation) - OK result
Is there any method I should call on InformationLayer or Observablecollection before I call InformationLayer(myObjektLayer).GetItemsInLocation(myLocation)?
I tried:
InformationLayer(myObjektLayer).BeginInit();
myObjektItemCollection.Add(myClass);
InformationLayer(myObjektLayer).EndInit();
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation)? No result