XamlUIPresenter Class
Definition
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.
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 ref class XamlUIPresenter sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.UI.Xaml.Hosting.HostingContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class XamlUIPresenter final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.UI.Xaml.Hosting.HostingContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class XamlUIPresenter
Public NotInheritable Class XamlUIPresenter
- Inheritance
- Attributes
Windows requirements
Device family |
Windows Desktop Extension SDK (introduced in 10.0.10240.0)
|
API contract |
Windows.UI.Xaml.Hosting.HostingContract (introduced in v1.0)
|
Remarks
XamlUIPresenter is not intended for general Microsoft DirectX and Windows Runtime interoperation scenarios. You cannot use this API in a UWP app that you submit to the Microsoft Store, it will not pass certification.
For techniques for XAML-Microsoft 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 Microsoft 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 Component Object Model (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
);
Properties
CompleteTimelinesAutomatically |
Gets or sets a value that determines whether the host wants timelines to always run to end. |
RootElement |
Gets or sets the root visual element to draw to the surface. |
ThemeKey |
Gets or sets the string key that identifies the theme set to use from ThemeResourcesXaml. |
ThemeResourcesXaml |
Gets 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. |
Methods
GetFlyoutPlacement(Rect, Size, Size, Rect, FlyoutPlacementMode, Boolean, FlyoutPlacementMode) |
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(FrameworkElement, FlyoutPlacementMode, FlyoutPlacementMode, Boolean) |
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(IXamlUIPresenterHost) |
Specifies the IXamlUIPresenterHost service implementation to use for application resource resolution. |
SetSize(Int32, Int32) |
Specifies the width and height of the surface. |