Ejemplo n.º 1
0
		public MonitorTextBoxPresenterItem(ElementTextBox element)
			: base(element)
		{
			var elementTextBox = ElementTextBox = element;

			var textBox = new TextBox();
			textBox.Style = null;
			textBox.BorderBrush = new SolidColorBrush(elementTextBox.BorderColor.ToWindowsColor());
			textBox.BorderThickness = new Thickness(elementTextBox.BorderThickness);
			textBox.Width = elementTextBox.Width;
			textBox.Height = elementTextBox.Height;
			textBox.Text = elementTextBox.Text;
			textBox.FontSize = elementTextBox.FontSize;
			textBox.FontFamily = new FontFamily(elementTextBox.FontFamilyName);
			if (elementTextBox.FontItalic)
				textBox.FontStyle = FontStyles.Italic;
			if (elementTextBox.FontBold)
				textBox.FontWeight = FontWeights.Bold;
			if (elementTextBox.WordWrap)
				textBox.TextWrapping = TextWrapping.Wrap;
			textBox.Background = new SolidColorBrush(elementTextBox.BackgroundColor.ToWindowsColor());
			textBox.Foreground = new SolidColorBrush(elementTextBox.ForegroundColor.ToWindowsColor());
			Canvas.SetLeft(textBox, elementTextBox.Left);
			Canvas.SetTop(textBox, elementTextBox.Top);
			WPFControl = textBox;
		}
Ejemplo n.º 2
0
		public MonitorTextBoxPresenterItem CreateMonitorTextBoxPresenterItem(ElementTextBox elementBase)
		{
			var presenterItem = new MonitorTextBoxPresenterItem(elementBase);
			Add(presenterItem);
			return presenterItem;
		}
Ejemplo n.º 3
0
		protected override ElementBaseRectangle CreateElement(double left, double top)
		{
			var element = new ElementTextBox() { Left = left, Top = top };
			var propertiesViewModel = new TextBoxPropertiesViewModel(element, DesignerCanvas);
			return DialogService.ShowModalWindow(propertiesViewModel) ? element : null;
		}