public TimePresenterViewModel(LayoutPartTimeProperties properties) { _properties = properties; BackgroundBrush = new SolidColorBrush(properties.BackgroundColor.ToWindowsColor()); ForegroundBrush = new SolidColorBrush(properties.ForegroundColor.ToWindowsColor()); BorderBrush = new SolidColorBrush(properties.BorderColor.ToWindowsColor()); BorderThickness = properties.BorderThickness; FontSize = properties.FontSize; FontStyle = properties.FontItalic ? FontStyles.Italic : FontStyles.Normal; FontWeight = properties.FontBold ? FontWeights.Bold : FontWeights.Normal; FontFamily = new FontFamily(properties.FontFamilyName); HorizontalAlignment = (HorizontalAlignment)properties.HorizontalAlignment; VerticalAlignment = (VerticalAlignment)properties.VerticalAlignment; Stretch = properties.Stretch ? Stretch.Fill : Stretch.None; _dispatcherTimer.Tick += (s, e) => Text = DateTime.Now.ToString(_properties.Format); }
public LayoutPartTimeViewModel(LayoutPartTimeProperties properties) { _properties = properties ?? new LayoutPartTimeProperties(); }