public LayoutProcedurePartViewModel(LayoutPartProcedureProperties properties) { Procedure = ClientManager.SystemConfiguration.AutomationConfiguration.Procedures.FirstOrDefault(item => item.Uid == properties.ReferenceUID); if (Procedure != null) Text = Procedure.Name; RunProcedureCommand = new RelayCommand(OnRunProcedure, CanRunProcedure); UseCustomStyle = properties.UseCustomStyle; if (UseCustomStyle) { 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); TextAlignment = (TextAlignment)properties.TextAlignment; Stretch = properties.Stretch ? Stretch.Fill : Stretch.None; } if (!string.IsNullOrWhiteSpace(properties.Text)) Text = properties.Text; }
public LayoutPartProcedureViewModel(LayoutPartProcedureProperties properties) { _properties = properties ?? new LayoutPartProcedureProperties(); UpdateLayoutPart(); }