RenderSurface

Sizing and layout

The layout behavior changes depending on which mode you use.

Manual mode sizing

In manual mode, the control can measure itself from the underlying surface size. If you present a 64x32 surface, its natural desired size becomes 64x32 unless parent layout constraints change the final arranged size.

Managed mode sizing

In managed mode, the control reports zero intrinsic size. That means you should normally set Width, Height, MinWidth, MinHeight, or place it in a layout that gives it real space.

Because RenderSurface inherits from SurfacePresenterBase, it also supports the standard surface scaling options:

  • Stretch="None": do not scale the content.
  • Stretch="Fill": stretch independently in both axes.
  • Stretch="Uniform": preserve aspect ratio and fit inside the slot.
  • Stretch="UniformToFill": preserve aspect ratio and fill the slot, cropping if needed.
  • StretchDirection="Both": allow upscaling and downscaling.
  • StretchDirection="UpOnly": do not shrink below natural size.
  • StretchDirection="DownOnly": do not grow above natural size.