UIElement.CompositeMode Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
public:
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" />
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.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |