示例#1
0
 protected override StyleUserControl CreateUI(StyleBuilderArguments styleArguments)
 {
     if (userControl == null)
     {
         userControl = new SimpleAreaStyleUserControl(ConcreteObject as AreaStyle);
     }
     return(userControl);
 }
示例#2
0
 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);
     }
 }