I'm trying to give the ability to the user to change between two modes ( with/without clustering). Right now I'm "nulling" the itemtemplate and removing the datamappings. what is the best and clean way to achieve this ?
One strage thing that happen swithing from one mode to another is that the points one the map are translated despide the fact the the underline data are unchanged.
ObservableCollection<MapItem> _dataItems = this.GetMapData(); if (MapConfigurationProperties.IsClusteringEnabled) { this.informationLayer.DataMappings.RemoveAll(); this.informationLayer.ItemTemplate = null; this.informationLayer.ClusteredDataSource = _dataSource; }else{ this.informationLayer.ClusteredDataSource = null; this.informationLayer.ItemTemplate = this.radMap.Resources["itemTemplate"] as DataTemplate; this.informationLayer.DataMappings.Add(new DataMapping("Location", DataMember.Location)); this.informationLayer.DataMappings.Add(new DataMapping("BaseZoomLevel", DataMember.ZoomLevel)); this.informationLayer.DataMappings.Add(new DataMapping("ZoomRange", DataMember.ZoomRange)); this.informationLayer.ItemsSource = _dataItems;}One strage thing that happen swithing from one mode to another is that the points one the map are translated despide the fact the the underline data are unchanged.