protected override StyleUserControl CreateUI(StyleBuilderArguments styleArguments) { if (userControl == null) { userControl = new SimpleLineStyleUserControl(ConcreteObject as LineStyle); } return(userControl); }
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (styleUIs.ContainsKey(value)) { return(styleUIs[value]); } else { StyleUserControl styleUserControl = null; if (value is AreaStyle) { styleUserControl = new SimpleAreaStyleUserControl((AreaStyle)value) { Width = double.NaN, Height = double.NaN }; } else if (value is LineStyle) { styleUserControl = new SimpleLineStyleUserControl((LineStyle)value) { Width = double.NaN, Height = double.NaN }; } else if (value is PointStyle) { styleUserControl = new SimplePointStyleUserControl((PointStyle)value) { Width = double.NaN, Height = double.NaN }; } else if (value is WellPointStyle) { styleUserControl = new WellPointStyleUserControl((WellPointStyle)value) { Width = double.NaN, Height = double.NaN }; } styleUIs[value] = styleUserControl; return(styleUserControl); } }