Example #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var stroke = (Brush)converter.Convert(value, targetType, parameter, culture);

            var solidBrush = stroke as SolidColorBrush;

            if (solidBrush != null)
            {
                Color color = solidBrush.Color;
                color.A = 128;

                return(new SolidColorBrush(color));
            }

            return(stroke);
        }
		private void OnForestConverterChanged(ForestConverter forestConverter)
		{
			Dictionary<string, TreeSpeciesInfo> dict = forestConverter.Mappings;

			foreach (var item in dict)
			{
				var geometry = (Geometry) forestDisplayGenerator.Resources[item.Value.ViewID];
				var crown = new Path
				            	{
				            		Width = 15,
				            		Height = 15,
				            		Data = geometry,
				            		Stretch = Stretch.Fill,
				            		Fill = (Brush) forestConverter.Convert(item.Key, typeof (Brush), null, null)
				            	};
				//plotter.NewLegend.AddLegendItem(markerChart, new NewLegendItem {Description = item.Key, VisualContent = crown});
			}
		}