Guys,
I have the following xaml below and bind my POI's ect via the ItemsSource Binding on the information layer. The information layer itself gets its shapedata by once static source for Asia.
Once I run the application I get the following exception:
Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead.
Is there any workaround you could offer in order to bind my map elements/POI's using the itemssource AND have the MapShapes configured in the XAML? I'd like to use as much MVVM I can and therefor I'd like to use data binding to my viewmodel.
Thanks,
XAML:
<telerik:RadMap x:Name="radMap" CommandBarVisibility="Visible" IsTextSearchEnabled="False">
<telerik:RadMap.Provider>
<telerik:EmptyProvider/>
</telerik:RadMap.Provider>
<telerik:InformationLayer x:Name="informationLayer" ItemsSource="{Binding MapData}">
<telerik:InformationLayer.Reader>
<telerik:MapShapeReader DataSource="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.dbf" Source="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.shp" ClearLayer="False" />
</telerik:InformationLayer.Reader>
<telerik:InformationLayer.ItemTemplate>
<DataTemplate>
<Grid telerik:MapLayer.BaseZoomLevel="{Binding BaseZoomLevel}"
telerik:MapLayer.Location="{Binding Location}"
telerik:MapLayer.ZoomRange="{Binding ZoomRange}">
<telerik:MapLayer.HotSpot>
<telerik:HotSpot X="0.5"
Y="0.5"
ElementName="PART_Ellipse" />
</telerik:MapLayer.HotSpot>
<Ellipse x:Name="PART_Ellipse"
Width="20"
Height="20"
Stroke="Red"
StrokeThickness="3"
Fill="Transparent">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Caption}" />
</ToolTipService.ToolTip>
</Ellipse>
</Grid>
</DataTemplate>
</telerik:InformationLayer.ItemTemplate>
</telerik:InformationLayer>
</telerik:RadMap>
I have the following xaml below and bind my POI's ect via the ItemsSource Binding on the information layer. The information layer itself gets its shapedata by once static source for Asia.
Once I run the application I get the following exception:
Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead.
Is there any workaround you could offer in order to bind my map elements/POI's using the itemssource AND have the MapShapes configured in the XAML? I'd like to use as much MVVM I can and therefor I'd like to use data binding to my viewmodel.
Thanks,
XAML:
<telerik:RadMap x:Name="radMap" CommandBarVisibility="Visible" IsTextSearchEnabled="False">
<telerik:RadMap.Provider>
<telerik:EmptyProvider/>
</telerik:RadMap.Provider>
<telerik:InformationLayer x:Name="informationLayer" ItemsSource="{Binding MapData}">
<telerik:InformationLayer.Reader>
<telerik:MapShapeReader DataSource="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.dbf" Source="/DTClientServices.PlanningSuite.Views;component/Shapefiles/Asia/asia.shp" ClearLayer="False" />
</telerik:InformationLayer.Reader>
<telerik:InformationLayer.ItemTemplate>
<DataTemplate>
<Grid telerik:MapLayer.BaseZoomLevel="{Binding BaseZoomLevel}"
telerik:MapLayer.Location="{Binding Location}"
telerik:MapLayer.ZoomRange="{Binding ZoomRange}">
<telerik:MapLayer.HotSpot>
<telerik:HotSpot X="0.5"
Y="0.5"
ElementName="PART_Ellipse" />
</telerik:MapLayer.HotSpot>
<Ellipse x:Name="PART_Ellipse"
Width="20"
Height="20"
Stroke="Red"
StrokeThickness="3"
Fill="Transparent">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Caption}" />
</ToolTipService.ToolTip>
</Ellipse>
</Grid>
</DataTemplate>
</telerik:InformationLayer.ItemTemplate>
</telerik:InformationLayer>
</telerik:RadMap>