Issue with child of custom Decorator class in WPF
- by galacticgrug
I need a custom border that renders a little differently than a normal border. I made a class that inherited from Decorator as follows
class BetterBorder : Decorator
{
protected override Size ArrangeOverride(Size arrangeSize)
{
return arrangeSize;
}
protected override void OnRender(DrawingContext dc)
{
//these values are calculated elsewhere
dc.DrawGeometry(backgroundBrush, borderPen, pathGeometry);
}
}
//Properties and helper methods below this
All of this works fine until I try to add a child to the control, the control can be added but is not visible and seems to be moved off BetterBorders visible client area. If I inherit from Border everything works fine, what am I missing?