Ejemplo n.º 1
0
		protected override bool Save()
		{
			PositionSettingsViewModel.SavePosition();
			ElementBase.Copy(this, this._elementPolyline);
			var colorConverter = new ColorToSystemColorConverter();
			_elementPolyline.BorderColor = (RubezhAPI.Color)colorConverter.ConvertBack(this.BorderColor, this.BorderColor.GetType(), null, null);
			_elementPolyline.BorderThickness = StrokeThickness;
			return base.Save();
		}
		protected override bool Save()
		{
			PositionSettingsViewModel.SavePosition();
			ElementBase.Copy(this, this.ElementRectangle);
			var colorConverter = new ColorToSystemColorConverter();
			ElementRectangle.BackgroundColor = (RubezhAPI.Color)colorConverter.ConvertBack(this.BackgroundColor, this.BackgroundColor.GetType(), null, null);
			ElementRectangle.BorderColor = (RubezhAPI.Color)colorConverter.ConvertBack(this.BorderColor, this.BorderColor.GetType(), null, null);
			ElementRectangle.BorderThickness = StrokeThickness;
			ImagePropertiesViewModel.Save();
			ElementRectangle.PlanElementBindingItems = PlanElementBindingItems;
			return base.Save();
		}
Ejemplo n.º 3
0
		public override void Invalidate()
		{
			IElementTextBlock elementText = (IElementTextBlock)Element;
			_textDrawing.Brush = PainterCache.GetBrush(elementText.ForegroundColor);
			if (elementText.Stretch)
			{
				_clipGeometry = null;
				_scaleTransform = new ScaleTransform();
			}
			else
			{
				_scaleTransform = null;
				_clipGeometry = new RectangleGeometry();
			}

			var item = DesignerCanvas.CommonDesignerItems.FirstOrDefault(p => p.Element.UID == Element.UID);

			if (item != null && item.WPFControl != null && item.WPFControl is TextBox)
			{
				var colorConverter = new ColorToSystemColorConverter();
				var wpfControl = item.WPFControl as TextBox;

				wpfControl.Background = new SolidColorBrush((Color)colorConverter.Convert(
					elementText.BackgroundColor, elementText.BackgroundColor.GetType(), null, null));
				wpfControl.BorderBrush = new SolidColorBrush((Color)colorConverter.Convert(
					elementText.BorderColor, elementText.BorderColor.GetType(), null, null));
				wpfControl.BorderThickness = new Thickness(elementText.BorderThickness);
				wpfControl.Foreground = new SolidColorBrush((Color)colorConverter.Convert(
					elementText.ForegroundColor, elementText.ForegroundColor.GetType(), null, null));
				wpfControl.FontSize = elementText.FontSize;
				wpfControl.FontFamily = new FontFamily(elementText.FontFamilyName);
				wpfControl.TextAlignment = (TextAlignment)elementText.TextAlignment;
				wpfControl.TextWrapping = elementText.WordWrap ? TextWrapping.Wrap : TextWrapping.NoWrap;
				wpfControl.VerticalAlignment = (VerticalAlignment)elementText.VerticalAlignment;
				//wpfControl.FontStretch = FontStretches.Condensed;
				//TODO: elementText.Stretch
			}

			base.Invalidate();
		}