Language
Edit

WindowsXamlHostBase Class

Definition

WindowsXamlHost control hosts UWP XAML content inside the Windows Presentation Foundation

public abstract class WindowsXamlHostBase : System.Windows.Interop.HwndHost
type WindowsXamlHostBase = class
    inherit HwndHost
Public MustInherit Class WindowsXamlHostBase
Inherits HwndHost
Inheritance
WindowsXamlHostBase
Derived

Constructors

Name Description
WindowsXamlHostBase()

Initializes a new instance of the WindowsXamlHostBase class.

WindowsXamlHostBase(String)

Initializes a new instance of the WindowsXamlHostBase class.

Properties

Name Description
ChildInternal

Gets or sets the root UWP XAML element displayed in the WPF control instance.

IsDisposed

Gets a value indicating whether this wrapper control instance been disposed

MetadataContainer

Gets the current instance of <seealso cref="T:Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication"></seealso>

Methods

Name Description
ArrangeOverride(Size)

Arranges wrapped UWP XAML content using passed in size constraint

Bind(String, DependencyProperty, DependencyProperty, Object, BindingDirection)

Binds this wrapper object's exposed WPF DependencyProperty with the wrapped UWP object's DependencyProperty for what effectively works as a regular one- or two-way binding.

BuildWindowCore(HandleRef)

Creates Windows.UI.Xaml.Application object, wrapped Windows.UI.Xaml.Hosting.DesktopWindowXamlSource instance; creates and sets root UWP XAML element on Windows.UI.Xaml.Hosting.DesktopWindowXamlSource.

DestroyWindowCore(HandleRef)

WPF framework request to destroy control window. Cleans up the HwndIslandSite created by DesktopWindowXamlSource

Dispose(Boolean)

WindowsXamlHost Dispose

GetUwpInternalObject()

Exposes ChildInternal without exposing its actual Type.

HasFocusWithinCore()
MeasureOverride(Size)

Measures wrapped UWP XAML content using passed in size constraint

OnChildChanged()

Called when the property <seealso cref="P:Microsoft.Toolkit.Wpf.UI.XamlHost.WindowsXamlHostBase.ChildInternal"></seealso> has changed.

OnGotFocus(RoutedEventArgs)

Override for OnGotFocus that passes NavigateFocus on to the DesktopXamlSource instance

OnInitialized(EventArgs) System.Windows.Interop.HwndHost.OnInitialized(System.EventArgs)
SetContent()

The default implementation of SetContent applies ChildInternal to desktopWindowXamSource.Content. Override this method if that shouldn't be the case. For example, override if your control should be a child of another WindowsXamlHostBase-based control.

TabIntoCore(TraversalRequest)

Process Tab from host framework

WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean)

Events

Name Description
ChildChanged

Fired when WindowsXamlHost root UWP XAML content has been updated

Applies to