void disposeOldLayer() { if (geoRssLayer != null) { geoRssLayer.Initialized -= geoRssLayer_Initialized; geoRssLayer.Graphics.CollectionChanged -= Graphics_CollectionChanged; geoRssLayer.Graphics.Clear(); geoRssLayer.Source = null; } geoRssLayer = null; }
private void refreshFeed() { Graphics.Clear(); // add a query parameter that is unique so that it causes int idx = geoRssLayer.Source.OriginalString.IndexOf("?_ts=", StringComparison.Ordinal); if (idx <= 0) { idx = geoRssLayer.Source.OriginalString.Length; } string subUri = geoRssLayer.Source.OriginalString.Substring(0, idx); Uri noCacheSource = new Uri(subUri + string.Format("?_ts={0}", DateTime.Now.Ticks)); disposeOldLayer(); geoRssLayer = new Client.Toolkit.DataSources.GeoRssLayer() { Source = noCacheSource }; geoRssLayer.Initialized += geoRssLayer_Initialized; geoRssLayer.Initialize(); }
public CustomGeoRssLayer() { geoRssLayer = new Client.Toolkit.DataSources.GeoRssLayer(); geoRssLayer.Initialized += geoRssLayer_Initialized; LayerSpatialReference = new SpatialReference(4326); }
void disposeOldLayer() { if (geoRssLayer != null) { geoRssLayer.Initialized -= geoRssLayer_Initialized; geoRssLayer.Graphics.CollectionChanged -= Graphics_CollectionChanged; geoRssLayer.Graphics.Clear(); geoRssLayer.Source = null; } geoRssLayer = null; }
public CustomGeoRssLayer() { geoRssLayer = new Client.Toolkit.DataSources.GeoRssLayer(); geoRssLayer.Initialized += geoRssLayer_Initialized; LayerSpatialReference = new SpatialReference(4326); }
private void refreshFeed() { Graphics.Clear(); // add a query parameter that is unique so that it causes int idx = geoRssLayer.Source.OriginalString.IndexOf("?_ts=", StringComparison.Ordinal); if (idx <= 0) idx = geoRssLayer.Source.OriginalString.Length; string subUri = geoRssLayer.Source.OriginalString.Substring(0, idx); Uri noCacheSource = new Uri(subUri + string.Format("?_ts={0}", DateTime.Now.Ticks)); disposeOldLayer(); geoRssLayer = new Client.Toolkit.DataSources.GeoRssLayer() { Source = noCacheSource }; geoRssLayer.Initialized += geoRssLayer_Initialized; geoRssLayer.Initialize(); }