public StaticLabel(OSAEObject sObj)
{
InitializeComponent();
screenObject = sObj;
string sValue = screenObject.Property("Value").Value; ;
string sBackColor = screenObject.Property("Background Color").Value;
string sForeColor = screenObject.Property("Fore Color").Value;
string iFontSize = screenObject.Property("Font Size").Value;
string sFontName = screenObject.Property("Font Name").Value;
if (sValue != "")
{
if (sBackColor != "")
{
try
{
BrushConverter conv = new BrushConverter();
SolidColorBrush brush = conv.ConvertFromString(sBackColor) as SolidColorBrush;
staticLabel.Background = brush;
}
catch { }
}
if (sForeColor != "")
{
try
{
BrushConverter conv = new BrushConverter();
SolidColorBrush brush = conv.ConvertFromString(sForeColor) as SolidColorBrush;
staticLabel.Foreground = brush;
}
catch { }
}
if (iFontSize != "")
{
try
{
staticLabel.FontSize = Convert.ToDouble(iFontSize);
}
catch { }
}
staticLabel.Content = sValue;
}
else
{
staticLabel.Content = "";
}
}