Visual.Size Property


The width and height of the visual. Animatable.

 property float2 Size { float2 get(); void set(float2 value); };
float2 Size();

void Size(float2 value);
public Vector2 Size { get; set; }
var vector2 = visual.size;
visual.size = vector2;
Public Property Size As Vector2

Property Value

Vector2 Vector2


The width and height of the visual.


See the code example in ContainerVisual.


This property can be animated. Call CompositionObject.StartAnimation to associate it with a CompositionAnimation.

The effective size of a Visual is found by adding its Size to its RelativeSizeAdjustment combined with the effective size of the Parent Visual:

var Effective_Size = Size + (RelativeSizeAdjustment * Parent.Effective_Size).

Applies to