コード例 #1
0
 private void SetPanelStyle(VisualStyle style)
 {
     if (style != null)
     {
         if (style.Width != 0)
         {
             BorderPanel.Width = style.Width;
         }
         else
         {
             BorderPanel.ClearValue(WidthProperty);
         }
         if (style.Height != 0)
         {
             BorderPanel.Height = style.Height;
         }
         else
         {
             BorderPanel.ClearValue(HeightProperty);
         }
         BorderPanel.Background = new SolidColorBrush(style.BackColor);
     }
 }
コード例 #2
0
        void ScoreObject_OnPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            ScoreItem scoreItem = ScoreGroup;

            if (scoreItem != null)
            {
                VisualStyle style = scoreItem.TitleStyle;
                if (style != null)
                {
                    LbTitle.Foreground     = new SolidColorBrush(style.ForeColor);
                    BorderTitle.Background = new SolidColorBrush(style.BackColor);
                    if (style.FontFamily != null)
                    {
                        LbTitle.FontFamily = style.FontFamily;
                    }
                    if (style.FontSize != 0)
                    {
                        LbTitle.FontSize = style.FontSize;
                    }
                    LbTitle.FontWeight = style.FontWeight;
                }
                style = scoreItem.PanelStyle;
                if (style != null)
                {
                    if (style.Width != 0)
                    {
                        BorderPanel.Width = style.Width;
                    }
                    else
                    {
                        BorderPanel.ClearValue(WidthProperty);
                    }
                    BorderPanel.Background = new SolidColorBrush(style.BackColor);
                }
            }
        }