Class
VisualTreeHost

Abstraction for something that contains a visual tree root. Silverlight applications and Popups.

Definition

Namespace:ArtOfTest.WebAii.Xaml

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class VisualTreeHost : IAutomationHost, ISupportSearchHost, IAnnotationHost

Inheritance: objectVisualTreeHost

Derived Classes: SilverlightAppWpfWindow

Implements: IAnnotationHostIAutomationHostISupportSearchHost

Properties

Annotator

Declaration

cs-api-definition
public virtual Annotator Annotator { get; }

Property Value

Annotator

Implements IAnnotationHost.Annotator

ContentWindow

Declaration

cs-api-definition
public virtual Window ContentWindow { get; }

Property Value

Window

Implements IAnnotationHost.ContentWindow

FriendlyName

Returns a friendly name for this host

Declaration

cs-api-definition
public virtual string FriendlyName { get; }

Property Value

string

Implements IAutomationHost.FriendlyName

Manager

Declaration

cs-api-definition
public virtual Manager Manager { get; }

Property Value

Manager

Implements IAnnotationHost.Manager

OwnerApp

The SilverlightApp containing this visual tree

Declaration

cs-api-definition
public IApplication OwnerApp { get; }

Property Value

IApplication

ShouldDisplayAnnotation

Declaration

cs-api-definition
public bool ShouldDisplayAnnotation { get; }

Property Value

bool

Implements IAnnotationHost.ShouldDisplayAnnotation

StateHashCode

Gets a unique identifier that identifies the state of this host

Declaration

cs-api-definition
public virtual string StateHashCode { get; }

Property Value

string

Implements IAutomationHost.StateHashCode

TechnologyType

VisualTreeHosts are only used for Silverlight

Declaration

cs-api-definition
public virtual TechnologyType TechnologyType { get; }

Property Value

TechnologyType

Implements IAutomationHost.TechnologyType

UniqueId

A unique identifier that identifies this plugin instance. This id is updated only when the plug-in is reloaded on a postback or a browser refresh.

Declaration

cs-api-definition
public virtual string UniqueId { get; }

Property Value

string

Implements IAutomationHost.UniqueId

VisualTree

The visual tree wrapped by this host object

Declaration

cs-api-definition
public VisualTree VisualTree { get; protected set; }

Property Value

VisualTree

Window

Declaration

cs-api-definition
public virtual Window Window { get; }

Property Value

Window

Implements IAnnotationHost.Window

Methods

Capture()

Return a bitmap of the host

Declaration

cs-api-definition
public virtual Bitmap Capture()

Returns

Bitmap

Implements IAutomationHost.Capture()

EnsureStateIsCurrent()

Will force the VisualTree to Refresh. Identical to VisualTree.Refresh().

Declaration

cs-api-definition
public virtual void EnsureStateIsCurrent()

Implements IAutomationHost.EnsureStateIsCurrent()

FixAnnotationArea(Rectangle)

Declaration

cs-api-definition
public virtual Rectangle FixAnnotationArea(Rectangle area)

Parameters

area

Rectangle

Returns

Rectangle

Implements IAnnotationHost.FixAnnotationArea(Rectangle)

GetChildHosts()

Get all contained hosts.

Declaration

cs-api-definition
public virtual IAutomationHost[] GetChildHosts()

Returns

IAutomationHost[]

Contained Hosts

Implements IAutomationHost.GetChildHosts()

GetHostRoot()

Returns the root target element of this host. VisualTree.Root

Declaration

cs-api-definition
public virtual ITargetElement GetHostRoot()

Returns

ITargetElement

The VisualTree.Root element

Implements IAutomationHost.GetHostRoot()

GetWindowRectangle()

Gets the rectangle of window containing this host

Declaration

cs-api-definition
public virtual Rectangle GetWindowRectangle()

Returns

Rectangle

Implements IAutomationHost.GetWindowRectangle()

LocateAllInHost(string[])

Locate all in host.

Declaration

cs-api-definition
public virtual IList<ITargetElement> LocateAllInHost(string[] expression)

Parameters

expression

string[]

The expression to use.

Returns

IList<ITargetElement>

The list of target elements

Implements ISupportSearchHost.LocateAllInHost(string[])

LocateInHost(string[])

Locate an element from the root of this host using an expression.

Declaration

cs-api-definition
public virtual ITargetElement LocateInHost(string[] expression)

Parameters

expression

string[]

Returns

ITargetElement

Implements ISupportSearchHost.LocateInHost(string[])

SetWindowFocus()

Makes the window containing this host active

Declaration

cs-api-definition
public virtual bool SetWindowFocus()

Returns

bool

Whether we successfully set the window to active

Implements IAutomationHost.SetWindowFocus()

Silverlight hosts have no inter-host links to update

Declaration

cs-api-definition
public void UpdateInterHostLinks()

Implements IAutomationHost.UpdateInterHostLinks()

ValidateMouseLocation(Point)

Validate the location of the mouse.

Declaration

cs-api-definition
public virtual void ValidateMouseLocation(Point point)

Parameters

point

Point

Implements IAutomationHost.ValidateMouseLocation(Point)