C#C
C#13mo ago
stigzler

Sloppy Constructors

I know I'm missing something here. There's likely a better way of doing the below?
public class SolidColorBrush : Brush
{
    public Color Color { get; set; } = System.Drawing.Color.White;

    public SolidColorBrush()
    {
        BrushType = Enums.BrushType.Color;
    }

    public SolidColorBrush(Color color)
    {
        Color = color;
        BrushType = Enums.BrushType.Color;
    }
}
Was this page helpful?