public LayoutTextBlockPartViewModel(LayoutPartTextProperties properties)
		{
			BackgroundBrush = new SolidColorBrush(properties.BackgroundColor.ToWindowsColor());
			FontStyle = properties.FontItalic ? FontStyles.Italic : FontStyles.Normal;
			FontWeight = properties.FontBold ? FontWeights.Bold : FontWeights.Normal;
			FontFamily = new FontFamily(properties.FontFamilyName);
			FontSize = properties.FontSize;
			ForegroundBrush = new SolidColorBrush(properties.ForegroundColor.ToWindowsColor());
			Text = properties.Text;
			TextAlignment = (TextAlignment)properties.TextAlignment;
			TextTrimming = properties.TextTrimming ? TextTrimming.CharacterEllipsis : TextTrimming.None;
			HorizontalAlignment = (HorizontalAlignment)properties.HorizontalAlignment;
			VerticalAlignment = (VerticalAlignment)properties.VerticalAlignment;
			TextWrapping = properties.WordWrap ? TextWrapping.Wrap : TextWrapping.NoWrap;
		}
예제 #2
0
		public LayoutTextBoxPartViewModel(LayoutPartTextProperties properties)
		{
			AcceptsReturn = properties.AcceptReturn;
			AcceptsTab = properties.AcceptTab;
			BackgroundBrush = new SolidColorBrush(properties.BackgroundColor.ToWindowsColor());
			FontStyle = properties.FontItalic ? FontStyles.Italic : FontStyles.Normal;
			FontWeight = properties.FontBold ? FontWeights.Bold : FontWeights.Normal;
			FontFamily = new FontFamily(properties.FontFamilyName);
			FontSize = properties.FontSize;
			ForegroundBrush = new SolidColorBrush(properties.ForegroundColor.ToWindowsColor());
			Text = properties.Text;
			TextAlignment = (TextAlignment)properties.TextAlignment;
			HorizontalAlignment = (HorizontalAlignment)properties.HorizontalAlignment;
			VerticalAlignment = (VerticalAlignment)properties.VerticalAlignment;
			TextWrapping = properties.WordWrap ? TextWrapping.Wrap : TextWrapping.NoWrap;
		}
예제 #3
0
		public LayoutPartTextViewModel(LayoutPartTextProperties properties, bool isEditable)
		{
			_properties = properties ?? new LayoutPartTextProperties();
			_isEditable = isEditable;
		}