Пример #1
0
			internal RefreshedEventArgs(LayerItemViewModel layerItem, Exception ex)
			{
				LayerItem = layerItem;
				Error = ex;
			}
Пример #2
0
		override void OnApplyTemplate()
		{
			base.OnApplyTemplate();

			if (!_isLoaded)
			{
				_isLoaded = true;

				if (CompatUtility.IsDesignMode && (Layers == null || !Layers.Any()))
				{
					if (_legendTree.LayerItems == null)
					{
						// Create a basic hierarchy for design :  Map Layer -> SubLayer -> LegendItemViewModel
						var legendItem1 = new LegendItemViewModel
						{
							Label = "LegendItem1",
							Symbol = new SimpleMarkerSymbol { Style = SimpleMarkerStyle.Circle, Color = Colors.Red }
						};
						var legendItem2 = new LegendItemViewModel
						{
							Label = "LegendItem2",
							Symbol = new SimpleMarkerSymbol { Style = SimpleMarkerStyle.Diamond, Color = Colors.Green }
						};

						var layerItem = new LayerItemViewModel
						{
							Label = "LayerItem",
							LegendItems = new ObservableCollection<LegendItemViewModel> { legendItem1, legendItem2 }
						};

						var mapLayerItem = new LayerItemViewModel
						{
							Label = "MapLayerItem",
							LayerType = MapLayerItem.MapLayerType,
							LayerItems = new ObservableCollection<LayerItemViewModel> { layerItem },
						};

						_legendTree.LayerItems = new ObservableCollection<LayerItemViewModel> { mapLayerItem };
					}

				}
				else
				{
					// Initialize the Map now that all parameters are well known
					_legendTree.Layers = Layers;
				}
			}
		}