I have a class that extends a Canvas
. On creation I explicitly set its width to a value:
Public Sub New(w As Integer, h As Integer)
Me.Width = w
Me.Height = h
End Sub
Now I add instances of this to a canvas to another canvas using cnvPreview.Children.Add(e)
where e
is the instance of my extended canvas.
However when I run the application, the ActualWidth
and ActualHeight
of these canvases are 0.
How can this be fixed?