UIElement.CompositeMode Property


Gets or sets a property that declares alternate composition and blending modes for the element in its parent layout and window. This is relevant for elements that are involved in a mixed XAML / Microsoft DirectX UI.

 property ElementCompositeMode CompositeMode { ElementCompositeMode get(); void set(ElementCompositeMode value); };
ElementCompositeMode CompositeMode();

void CompositeMode(ElementCompositeMode value);
public ElementCompositeMode CompositeMode { get; set; }
var elementCompositeMode = uIElement.compositeMode;
uIElement.compositeMode = elementCompositeMode;
Public Property CompositeMode As ElementCompositeMode
<uiElement CompositeMode="elementCompositeModeMemberName" />

Property Value


A value of the enumeration. The default is Inherit, but see Remarks.


If left unset, the default value of CompositeMode is ElementCompositeMode.Inherits. This means that the composite mode inherits from successive parents in the visual tree. However, at the root of a XAML visual tree is a final object representing the hWnd that is not typically represented in user code, and its effective CompositeMode behavior is SourceOver. Therefore, unless some element in the chain is specifically set to MinBlend, the render behavior of XAML elements all inherit to use SourceOver as inherited from the parent window.

Setting CompositeMode to MinBlend is useful for a mixed XAML / Microsoft DirectX UI because it is information used by the Direct Composition layer when it combines the UI sources. The MinBlend behavior can be better for situations such as text overlays.

Setting a value of MinBlend is typically most relevant for a SwapChainPanel element, so that the hosted content gets this behavior. But for some scenarios such as text overlays it can also be set on specific UI elements such as Rectangle, Canvas and so on.

Applies to

See also