icsharpcode / WpfDesigner

The WPF Designer from SharpDevelop
MIT License
958 stars 259 forks source link

Not referenced to an instance(Occurs when a drag operation enters the design panel) #102

Closed QuarkSoftware closed 5 months ago

QuarkSoftware commented 1 year ago
public class MyControl : Control
{
    ...
    protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
    {
        base.OnRenderSizeChanged(sizeInfo);
        if (DesignerProperties.GetIsInDesignMode(this))
        {
            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);//Not referenced to an instance(Occurs when a drag operation enters the design panel).
            if (adornerLayer != null)
            {
                //TODO:...
            }
        }
    }
    ...
}
jogibear9988 commented 1 year ago

cold you create a pull req to fix this?