I am developing a UserControl that consists of a block with a heading and a list of items (as ItemsControl). The usercontrol is added dynamically to a canvas. I
ItemsControl
Try using ActualWidth and ActualHeight properties.
ActualWidth
ActualHeight
protected override Size MeasureOverride(Size availableSize) { var desiredSize = new Size(); var sideLength = Math.Min(ActualWidth, ActualHeight); desiredSize.Width = sideLength; desiredSize.Height = sideLength; return desiredSize; }