Today im working in WPF.
I tried to inherit from System.Windows.Shapes.Line
class, like this:
class MyLine : System.Windows.Shapes.Line
{
public Ln()
{
this.Stroke = Brushes.Black;
}
}
I just realized, that Line class is sealed.
My goal is to create a class, that will work like Line
class (to put it on Canvas
), but I don't want to mess my code with adding brush to it everytime, lets say always want black brush/stroke with 2px width.
I feel im trying to do it wrong.
How should I do that?