private void InitGridPanelStyle(DefaultVisualStyles visualStyle, ColorFactory factory) { GridPanelVisualStyle style = new GridPanelVisualStyle(); style.Background = new Background(factory.GetColor(0xFFFFFF)); style.BorderColor = new BorderColor(factory.GetColor(0x313131)); style.BorderPattern.All = LinePattern.Solid; style.BorderThickness = new Thickness(1); style.TextColor = factory.GetColor(0x000000); style.TreeLineColor = factory.GetColor(0x484848); style.HeaderLineColor = factory.GetColor(0x444444); style.HorizontalLineColor = factory.GetColor(0xDADCDD); style.VerticalLineColor = factory.GetColor(0xDADCDD); style.TreeLinePattern = LinePattern.Solid; style.HorizontalLinePattern = LinePattern.Solid; style.VerticalLinePattern = LinePattern.Solid; style.HeaderHLinePattern = LinePattern.Solid; style.HeaderVLinePattern = LinePattern.Solid; BaseTreeButtonVisualStyle tstyle = new BaseTreeButtonVisualStyle(); tstyle.BorderColor = factory.GetColor(Color.SlateGray); tstyle.HotBorderColor = factory.GetColor(Color.SlateGray); tstyle.LineColor = factory.GetColor(Color.DarkSlateGray); tstyle.HotLineColor = factory.GetColor(Color.DarkSlateGray); tstyle.Background = new Background(factory.GetColor(Color.White), factory.GetColor(Color.Gainsboro), 90); tstyle.HotBackground = new Background(factory.GetColor(Color.White), factory.GetColor(Color.Gainsboro), 90); style.CircleTreeButtonStyle.CollapseButton = tstyle; style.CircleTreeButtonStyle.ExpandButton = tstyle; style.SquareTreeButtonStyle.CollapseButton = tstyle; style.SquareTreeButtonStyle.ExpandButton = tstyle; tstyle = new BaseTreeButtonVisualStyle(); tstyle.BorderColor = factory.GetColor(Color.Black); tstyle.HotBorderColor = factory.GetColor(0x27C7F7); tstyle.Background = new Background(factory.GetColor(Color.Black)); tstyle.HotBackground = new Background(factory.GetColor(0xC7EBFA)); style.TriangleTreeButtonStyle.CollapseButton = tstyle; tstyle = new BaseTreeButtonVisualStyle(); tstyle.BorderColor = factory.GetColor(Color.DimGray); tstyle.HotBorderColor = factory.GetColor(0x27C7F7); tstyle.Background = new Background(factory.GetColor(Color.White)); tstyle.HotBackground = new Background(factory.GetColor(0xC7EBFA)); style.TriangleTreeButtonStyle.ExpandButton = tstyle; visualStyle.GridPanelStyle = style; }
private void ResetExpandButton() { ExpandButton = null; }
private void ResetCollapseButton() { CollapseButton = null; }
/// <summary> /// Returns the copy of the style. /// </summary> /// <returns>Copy of the style.</returns> public void CopyTo(BaseTreeButtonVisualStyle copy) { base.CopyTo(copy); copy.BorderColor = _BorderColor; copy.HotBorderColor = _HotBorderColor; copy.LineColor = _LineColor; copy.HotLineColor = _HotLineColor; if (Background != null) copy.Background = _Background.Copy(); if (HotBackground != null) copy.HotBackground = _HotBackground.Copy(); }
/// <summary> /// Returns the copy of the style. /// </summary> /// <returns>Copy of the style.</returns> public new BaseTreeButtonVisualStyle Copy() { BaseTreeButtonVisualStyle style = new BaseTreeButtonVisualStyle(); CopyTo(style); return (style); }
/// <summary> /// Applies the style to instance of this style. /// </summary> /// <param name="style">Style to apply.</param> public void ApplyStyle(BaseTreeButtonVisualStyle style) { if (style != null) { base.ApplyStyle(style); if (style.BorderColor.IsEmpty == false) BorderColor = style.BorderColor; if (style.HotBorderColor.IsEmpty == false) HotBorderColor = style.HotBorderColor; if (style.Background != null && style.Background.IsEmpty == false) Background = style.Background.Copy(); if (style.HotBackground != null && style.HotBackground.IsEmpty == false) HotBackground = style.HotBackground.Copy(); if (style.LineColor.IsEmpty == false) LineColor = style.LineColor; if (style.HotLineColor.IsEmpty == false) HotLineColor = style.HotLineColor; } }
private void InitGridPanelStyle(DefaultVisualStyles visualStyle, ColorFactory factory) { GridPanelVisualStyle style = new GridPanelVisualStyle(); MetroPartColors metroColors = _MetroPartColors; style.Background = new Background(factory.GetColor(metroColors.CanvasColor)); style.BorderColor = new BorderColor(factory.GetColor(metroColors.CanvasColorDarkShade)); style.BorderPattern.All = LinePattern.Solid; style.BorderThickness = new Thickness(1); style.TextColor = factory.GetColor(metroColors.TextColor); style.TreeLineColor = factory.GetColor(metroColors.CanvasColorLighterShade); style.HeaderLineColor = factory.GetColor(metroColors.CanvasColorDarkShade); style.HorizontalLineColor = factory.GetColor(metroColors.CanvasColorLighterShade); style.VerticalLineColor = factory.GetColor(metroColors.CanvasColorLighterShade); style.TreeLinePattern = LinePattern.Solid; style.HorizontalLinePattern = LinePattern.Solid; style.VerticalLinePattern = LinePattern.Solid; style.HeaderHLinePattern = LinePattern.Solid; style.HeaderVLinePattern = LinePattern.Solid; BaseTreeButtonVisualStyle tstyle = new BaseTreeButtonVisualStyle(); tstyle.BorderColor = factory.GetColor(metroColors.CanvasColorLighterShade); tstyle.HotBorderColor = factory.GetColor(metroColors.CanvasColorLighterShade); tstyle.LineColor = factory.GetColor(metroColors.CanvasColorDarkShade); tstyle.HotLineColor = factory.GetColor(metroColors.CanvasColorDarkShade); tstyle.Background = new Background(factory.GetColor(metroColors.CanvasColor), factory.GetColor(metroColors.CanvasColorDarkShade), 90); tstyle.HotBackground = new Background(factory.GetColor(metroColors.CanvasColor), factory.GetColor(metroColors.CanvasColorDarkShade), 90); style.CircleTreeButtonStyle.CollapseButton = tstyle; style.CircleTreeButtonStyle.ExpandButton = tstyle; style.SquareTreeButtonStyle.CollapseButton = tstyle; style.SquareTreeButtonStyle.ExpandButton = tstyle; style.TriangleTreeButtonStyle.CollapseButton = tstyle; style.TriangleTreeButtonStyle.ExpandButton = tstyle; style.TriangleTreeButtonStyle.ExpandButton = tstyle; visualStyle.GridPanelStyle = style; }