Export (0) Print
Expand All
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

XamlUIPresenter class

Applies to Windows only

Enables presenting a visual tree on a Microsoft Direct3D surface. This type is used for design tool hosting scenarios and is not intended for general use.




public sealed class XamlUIPresenter




The XamlUIPresenter class has these types of members:


The XamlUIPresenter class has these methods. It also inherits methods from the Object class.

GetFlyoutPlacement Invokes the FlyoutBase placement logic, using a suggested size of a control that will show a placement target and its flyout. Returns the bounds that are the result of running the placement logic.
GetFlyoutPlacementTargetInfo Returns calculated bounds of a placement target that is intended to also display a flyout in the host. Additional out parameters provide more info on how the bounds were calculated.
NotifyWindowSizeChanged Invokes the SizeChanged event on Window.Current. Used by hosts to propagate size changes from host settings to user code, so that a design mode interaction can be differentiated from a run time interaction.
Present Presents the surface, as a synchronous call for the host.
Render Renders the surface. Intended for asynchronous calls via a timer.
SetHost Specifies the IXamlUIPresenterHost service implementation to use for application resource resolution.
SetSize Specifies the width and height of the surface.



The XamlUIPresenter class has these properties.

PropertyAccess typeDescription


Read/writeGets or sets a value that determines whether the host wants timelines to always run to end.


Read/writeGets or sets the root visual element to draw to the surface.


Read/writeGets or sets the string key that identifies the theme set to use from ThemeResourcesXaml.


Read/writeGets or sets the XAML that specifies a resource dictionary. The resource dictionary contains themes that the host should resolve and that should be applied to the content.



XamlUIPresenter is not intended for general Microsoft DirectX and Windows Runtime interoperation scenarios. You cannot use this API in a Windows Store app that you submit to the Windows Store, it will not pass certification.

For techniques for XAML-DirectX interoperation functionality, instead see DirectX and XAML interop.

XamlUIPresenter is specifically intended for interoperation with designer surfaces that represent Windows Runtime objects or their XAML markup as graphical objects in a DirectX UI.

XamlUIPresenter has no constructor in the Windows Runtime. To get an instance of XamlUIPresenter you must invoke a Component Object Model (COM) function (CreateXamlUIPresenter) as exported from a Windows Runtime DLL. For example, as part of a C# application you can import the COM library:

[DllImport("windows.ui.xaml.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
public static extern void CreateXamlUIPresenter(
    IViewObjectPresentNotifySite presentSite, out Windows.UI.Xaml.Hosting.XamlUIPresenter presenter


Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported


Windows::UI::Xaml::Hosting [C++]





© 2014 Microsoft