Partager via


IXRVisualHost (Windows Embedded CE 6.0)

1/6/2010

This class hosts the visual tree of objects inside a Window (HWND) container so that the objects, both parsed from XAML and created in C++, can respond to events and window messages at run time.

This class also supports the methods on the IUnknown interface.

Syntax

class IXRVisualHost :  public IUnknown

Methods

Method Description

IXRVisualHost::DestroyWindow

Closes and destroys this visual host object.

IXRVisualHost::EndDialog

Closes and destroys the modal dialog created by using IXRVisualHost::StartDialog.

IXRVisualHost::GetContainerHWND

Obtains a handle (HWND) to the raw operating-system (OS) window that provides the foundation for this visual host.

IXRVisualHost::GetFocusedElement

Retrieves the element in the hosted element tree that currently has the user-interface (UI) focus.

IXRVisualHost::GetPosition

Retrieves the current on-screen position of this visual host.

IXRVisualHost::GetRootElement

Retrieves the top-level UI element in the element tree that is hosted by this visual host.

IXRVisualHost::GetSize

Retrieves the size dimensions of the graphical window for the container of this visual host.

IXRVisualHost::HideWindow

Hides this visual host (if it was previously displayed on-screen) and stops rendering the element tree.

IXRVisualHost::SetPosition

Sets the current on-screen position of this visual host.

IXRVisualHost::SetSize

Sets new size dimensions for the graphical window for the container of this visual host.

IXRVisualHost::ShowWindow

Shows this visual host (if it was previously hidden) and renders its element tree onto the graphical window.

IXRVisualHost::StartDialog

Starts this visual host as a modal dialog box, which requires the user to supply information or dismiss the dialog box before enabling the application to continue.

Remarks

A visual host enables the system to interact with elements in its visual tree in a manner similar to how it interacts with a window. It does this by hosting an element collection in an underlying window container. The visual host is responsible for the underlying window's WndProc and handles messages sent to the window, including dispatching them to the appropriate element in Silverlight element tree. A visual host can contain only one element tree.

A visual host automatically handles relevant Win32 events on behalf of the client. This includes the following:

  • Input events (IME events, key presses, stylus taps, and more)
  • Window resizing events
  • Focus events (moving from background to foreground)
  • Interaction with other windows in the system
  • Screen-rotation events

Each IXRVisualHost object provides a pointer to an element tree. You can obtain the root element of that tree by calling IXRVisualHost::GetRootElement. That pointer represents the root object of the tree for that host, and is a pointer to an IXRFrameworkElement object. You can use the handle to the root element for adding objects to the element tree, modifying objects in the tree, rendering the objects on-screen, and so on.

IXRVisualHost also encapsulates the windowing functionality by containing an HWND, or window handle, to an underlying window for the visual host. You can obtain the HWND by calling IXRVisualHost::GetContainerHWND. You can use the container HWND if you want to call into GWES functionality, such as calling the UpdateWindow method.**

You can create an instance of an IXRVisualHost object by calling either IXRApplication::CreateHostFromXaml or IXRApplication::CreateHostFromElementTree.

.NET Framework Equivalent

None.

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

Classes for Application Management

Concepts

Populate On-Screen Content for a Silverlight for Windows Embedded Application