Class
FrameworkElement

The base FrameworkElement that represents any visual element in the Silverlight application.

Definition

Namespace:ArtOfTest.WebAii.Silverlight

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
[DataContract]
public class FrameworkElement : AutomationObject<FrameworkElement>, IAutomationPeer, IPeerConverter, IFrameworkElement, ITargetElement

Inheritance: objectAutomationObject<FrameworkElement>FrameworkElement

Derived Classes: SilverlightTestElementWpfTestElementGanttVirtulizedPanelGridViewGroupPanelItemAxis3DBarSeries3DGridViewGroupPanelItemGridViewSearchPanelPointSeries3DSurfaceSeries3D

Implements: IAutomationPeerIFrameworkElementIPeerConverterITargetElement

Inherited Members AutomationObject<FrameworkElement>.GetProperty(AutomationProperty)AutomationObject<FrameworkElement>.GetProperty(AutomationProperty, object)AutomationObject<FrameworkElement>.SetProperty(AutomationProperty, object)AutomationObject<FrameworkElement>.InvokeMethod(AutomationMethod, params object[])AutomationObject<FrameworkElement>.InvokeMethod(string, params object[])AutomationObject<FrameworkElement>.Serialize()AutomationObject<FrameworkElement>.Deserialize(string)AutomationObject<FrameworkElement>.ReferenceAutomationObject<FrameworkElement>.PropertyBag

Constructors

FrameworkElement()

Create a new FrameworkElement.

Declaration

cs-api-definition
public FrameworkElement()

Fields

ActualHeightProperty

Defines how to get the ActualHeight property of this element.

Declaration

cs-api-definition
public static AutomationProperty ActualHeightProperty

Field Value

AutomationProperty

ActualWidthProperty

Defines how to get the ActualWidth property of this element.

Declaration

cs-api-definition
public static AutomationProperty ActualWidthProperty

Field Value

AutomationProperty

ClipProperty

Defines how to get the Clip property of this element.

Declaration

cs-api-definition
public static AutomationProperty ClipProperty

Field Value

AutomationProperty

DataContextProperty

Defines how to get the DataContext property of this element.

Declaration

cs-api-definition
public static AutomationProperty DataContextProperty

Field Value

AutomationProperty

DesiredSizeProperty

Defines how to get the DesiredSize property of this element.

Declaration

cs-api-definition
public static AutomationProperty DesiredSizeProperty

Field Value

AutomationProperty

HeightProperty

Defines how to get the Height property of this element.

Declaration

cs-api-definition
public static AutomationProperty HeightProperty

Field Value

AutomationProperty

HorizontalAlignmentProperty

Defines how to get the HorizontalAlignment property of this element.

Declaration

cs-api-definition
public static AutomationProperty HorizontalAlignmentProperty

Field Value

AutomationProperty

IsHitTestVisibleProperty

Defines how to get the IsHitTestVisible property of this element.

Declaration

cs-api-definition
public static AutomationProperty IsHitTestVisibleProperty

Field Value

AutomationProperty

MarginProperty

Defines how to get the Margin property of this element.

Declaration

cs-api-definition
public static AutomationProperty MarginProperty

Field Value

AutomationProperty

MaxHeightProperty

Defines how to get the MaxHeight property of this element.

Declaration

cs-api-definition
public static AutomationProperty MaxHeightProperty

Field Value

AutomationProperty

MaxWidthProperty

Defines how to get the MaxWidth property of this element.

Declaration

cs-api-definition
public static AutomationProperty MaxWidthProperty

Field Value

AutomationProperty

MinHeightProperty

Defines how to get the MinHeight property of this element.

Declaration

cs-api-definition
public static AutomationProperty MinHeightProperty

Field Value

AutomationProperty

MinWidthProperty

Defines how to get the MinWidth property of this element.

Declaration

cs-api-definition
public static AutomationProperty MinWidthProperty

Field Value

AutomationProperty

NameProperty

Defines how to get the Name property of this element.

Declaration

cs-api-definition
public static AutomationProperty NameProperty

Field Value

AutomationProperty

OpacityMaskProperty

Defines how to get the OpacityMask property of this element.

Declaration

cs-api-definition
public static AutomationProperty OpacityMaskProperty

Field Value

AutomationProperty

OpacityProperty

Defines how to get the Opacity property of this element.

Declaration

cs-api-definition
public static AutomationProperty OpacityProperty

Field Value

AutomationProperty

RenderSizeProperty

Defines how to get the RenderSize property of this element.

Declaration

cs-api-definition
public static AutomationProperty RenderSizeProperty

Field Value

AutomationProperty

RenderTransformOriginProperty

Defines how to get the RenderTransformOrigin property of this element.

Declaration

cs-api-definition
public static AutomationProperty RenderTransformOriginProperty

Field Value

AutomationProperty

RenderTransformProperty

Defines how to get the RenderTransform property of this element.

Declaration

cs-api-definition
public static AutomationProperty RenderTransformProperty

Field Value

AutomationProperty

TagProperty

Defines how to get the Tag property of this element.

Declaration

cs-api-definition
public static AutomationProperty TagProperty

Field Value

AutomationProperty

VerticalAlignmentProperty

Defines how to get the VerticalAlignment property of this element.

Declaration

cs-api-definition
public static AutomationProperty VerticalAlignmentProperty

Field Value

AutomationProperty

VisibilityProperty

Defines how to get the Visibility property of this element.

Declaration

cs-api-definition
public static AutomationProperty VisibilityProperty

Field Value

AutomationProperty

WidthProperty

Defines how to get the Width property of this element.

Declaration

cs-api-definition
public static AutomationProperty WidthProperty

Field Value

AutomationProperty

Properties

AbsoluteSiblingTagIndex

Get the sibling tag index of this FrameworkElement.

Declaration

cs-api-definition
public int AbsoluteSiblingTagIndex { get; }

Property Value

int

Implements IFrameworkElement.AbsoluteSiblingTagIndex

AbsoluteTagIndex

Get the absolute index of this Xaml tag in the Visual Tree.

Declaration

cs-api-definition
public int AbsoluteTagIndex { get; }

Property Value

int

ActualHeight

Gets the value of the ActualHeight of this element.

Declaration

cs-api-definition
public double ActualHeight { get; }

Property Value

double

Implements IFrameworkElement.ActualHeight

ActualWidth

Gets the value of the ActualWidth of this element.

Declaration

cs-api-definition
public double ActualWidth { get; }

Property Value

double

Implements IFrameworkElement.ActualWidth

Application

Get the Application object that owns this element.

Declaration

cs-api-definition
[Browsable(false)]
public IApplication Application { get; }

Property Value

IApplication

AutomationId

Gets the AutomationId set on this element if any.

Declaration

cs-api-definition
public string AutomationId { get; }

Property Value

string

Children

Gets the visual children of this element.

Declaration

cs-api-definition
public IList<FrameworkElement> Children { get; }

Property Value

IList<FrameworkElement>

Clip

Gets / Sets the value of the Clip of this element.

Declaration

cs-api-definition
public Geometry Clip { get; set; }

Property Value

Geometry

ComputedVisibility

Declaration

cs-api-definition
public virtual Visibility ComputedVisibility { get; }

Property Value

Visibility

Implements IFrameworkElement.ComputedVisibility

Depth

Get the depth of this element in the Visual Tree.

Declaration

cs-api-definition
public int Depth { get; }

Property Value

int

Implements ITargetElement.Depth

DesiredSize

Gets the value of the DesiredSize of this element.

Declaration

cs-api-definition
public Size DesiredSize { get; }

Property Value

Size

EnableValidateMouseLocation

Enables or disables the validation of mouse click locations before performing mouse actions

Declaration

cs-api-definition
public bool EnableValidateMouseLocation { get; set; }

Property Value

bool

Find

Get the Find object used to search the visual children of this element.

Declaration

cs-api-definition
[Browsable(false)]
public VisualFind Find { get; }

Property Value

VisualFind

Implements IFrameworkElement.Find

Height

Gets / Sets the value of the Height of this element.

Declaration

cs-api-definition
public double Height { get; set; }

Property Value

double

HorizontalAlignment

Gets / Sets the value of the HorizontalAlignment of this element.

Declaration

cs-api-definition
public HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

Host

Returns the AutomationHost for this object.

Declaration

cs-api-definition
public IAutomationHost Host { get; }

Property Value

IAutomationHost

Implements ITargetElement.Host

IsHitTestVisible

Gets / Sets the value of the IsHitTestVisible of this element.

Declaration

cs-api-definition
public bool IsHitTestVisible { get; set; }

Property Value

bool

IsTestRegion

Gets whether or not this element is contained in a test region.

Declaration

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

Property Value

bool

Implements ITargetElement.IsTestRegion

IsVisible

Declaration

cs-api-definition
public virtual bool IsVisible { get; }

Property Value

bool

Mappings

Gets a mappings collection that stores customizable control specific mapping knowledge that can be later customized.

Declaration

cs-api-definition
public virtual MappingsCollection Mappings { get; }

Property Value

MappingsCollection

Margin

Gets / Sets the value of the Margin of this element.

Declaration

cs-api-definition
public Thickness Margin { get; set; }

Property Value

Thickness

MaxHeight

Gets / Sets the value of the MaxHeight of this element.

Declaration

cs-api-definition
public double MaxHeight { get; set; }

Property Value

double

MaxWidth

Gets / Sets the value of the MaxWidth of this element.

Declaration

cs-api-definition
public double MaxWidth { get; set; }

Property Value

double

MinHeight

Gets / Sets the value of the MinHeight of this element.

Declaration

cs-api-definition
public double MinHeight { get; set; }

Property Value

double

MinWidth

Gets /Sets the value of the MinWidth of this element.

Declaration

cs-api-definition
public double MinWidth { get; set; }

Property Value

double

Name

Gets the value of the Name of this element.

Declaration

cs-api-definition
public string Name { get; }

Property Value

string

Implements IFrameworkElement.Name

Opacity

Gets / Sets the value of the Opacity of this element.

Declaration

cs-api-definition
public double Opacity { get; set; }

Property Value

double

OpacityMask

Gets / Sets the value of the OpacityMask of this element.

Declaration

cs-api-definition
public Brush OpacityMask { get; set; }

Property Value

Brush

ParsedElement

Get the parsed element under this object.

Declaration

cs-api-definition
public ParsedElement ParsedElement { get; }

Property Value

ParsedElement

Implements ITargetElement.ParsedElement

RenderSize

Gets the value of the RenderSize of this element.

Declaration

cs-api-definition
public Size RenderSize { get; }

Property Value

Size

RenderTransform

Gets / Sets the value of the RenderTransform of this element.

Declaration

cs-api-definition
public Transform RenderTransform { get; set; }

Property Value

Transform

RenderTransformOrigin

Gets / Sets the value of the RenderTransformOrigin of this element.

Declaration

cs-api-definition
public Point RenderTransformOrigin { get; set; }

Property Value

Point

TagNameIndex

Gets the tag name index of the xaml tag name in the visual tree.

Declaration

cs-api-definition
public int TagNameIndex { get; }

Property Value

int

TechnologyType

Get the technology type of this element.

Declaration

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

Property Value

TechnologyType

Implements ITargetElement.TechnologyType

Text

Gets the element text, the first text block text by default.

Declaration

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

Property Value

string

Implements IFrameworkElement.Text

TextBlockContent

Gets the text from all the inner TextBlock elements.

Declaration

cs-api-definition
public string TextBlockContent { get; }

Property Value

string

Implements IFrameworkElement.TextBlockContent

TextLiteralContent

Gets the literal text content of this framework element if any.

Declaration

cs-api-definition
public string TextLiteralContent { get; }

Property Value

string

Implements IFrameworkElement.TextLiteralContent

ToolTipText

The text of the tooltip specified for this element

Declaration

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

Property Value

string

Implements IFrameworkElement.ToolTipText

Uid

Unique identifier for this control in its application. For internal use.

Declaration

cs-api-definition
public string Uid { get; }

Property Value

string

Implements IFrameworkElement.Uid

User

Gets the UI interaction object that allows you to interact with this framework element directly using real mouse and keyboard interactions

Declaration

cs-api-definition
[Browsable(false)]
public virtual UserInteraction User { get; }

Property Value

UserInteraction

Implements IFrameworkElement.User

VerticalAlignment

Gets / Sets the value of the VerticalAlignment of this element.

Declaration

cs-api-definition
public VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

Visibility

Gets / Sets the value of the Visibility of this element.

Declaration

cs-api-definition
public Visibility Visibility { get; set; }

Property Value

Visibility

Wait

Gets a VisualWait object to be used on waiting for Visual elemnets in the VisualTree.

Declaration

cs-api-definition
[Browsable(false)]
public VisualWait Wait { get; }

Property Value

VisualWait

Implements IFrameworkElement.Wait

Width

Gets / Sets the value of the Width of this element.

Declaration

cs-api-definition
public double Width { get; set; }

Property Value

double

XamlTag

Get the xaml tag name of this FrameworkElement. This is used for hierarchy matching and traversal.

Declaration

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

Property Value

string

XamlTagBase

Gets the lowest control type that the framework recognizes

Declaration

cs-api-definition
public string XamlTagBase { get; }

Property Value

string

Methods

AddChildNode(ITargetElement)

Add a child node to this framework element.

Declaration

cs-api-definition
public void AddChildNode(ITargetElement child)

Parameters

child

ITargetElement

Implements ITargetElement.AddChildNode(ITargetElement)

AnySibling(string)

Return any sibling of this control of the specified type. This method searches the previous siblings first, then the next sibilings.

Declaration

cs-api-definition
public FrameworkElement AnySibling(string controlType)

Parameters

controlType

string

The desired control type to match (i.e. 'Button', 'Calendar' ...etc)

Returns

FrameworkElement

The matching sibling else null.

AnySibling<T>()

Return any sibling of this control of the specified type.

Declaration

cs-api-definition
public T AnySibling<T>() where T : FrameworkElement

Returns

T

As<T>()

Return this framework element as a strongly-typed control.

Declaration

cs-api-definition
public T As<T>() where T : FrameworkElement

Returns

T

The desired control instance.

AssignReference(AutomationReference)

Assign the automation reference to this element.

Declaration

cs-api-definition
public override void AssignReference(AutomationReference reference)

Parameters

reference

AutomationReference

The automation reference to assign.

Overrides AutomationObject<FrameworkElement>.AssignReference(AutomationReference)

Implements IFrameworkElement.AssignReference(AutomationReference)

Capture()

Capture the image of this element.

Declaration

cs-api-definition
public Bitmap Capture()

Returns

Bitmap

Implements ITargetElement.Capture()

CaptureImage()

Captures the image of current element with scaling and OS information.

Declaration

cs-api-definition
public ElementImage CaptureImage()

Returns

ElementImage

ElementsImage object of current element.

Implements ITargetElement.CaptureImage()

CastAs<T>()

Returns this framework element as a strongly-typed control without enforcing tag name to match the type. This functions gives you free casting abilities between types.

Declaration

cs-api-definition
public T CastAs<T>() where T : IFrameworkElement

Returns

T

The control type

Implements IFrameworkElement.CastAs<T>()

EnsureClickable()

Performs best-effort operations to ensure that this element is user-visible and avialable for simulated user actions.

Declaration

cs-api-definition
public void EnsureClickable()

Equals(object)

Determines whether this FrameworkElement is equal to another, by comparing their AutomationReferences

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The object to compare this FrameworkElement to

Returns

bool

True if obj is a FrameworkElement and its AutomationReference refers to the same element as this one's

Overrides object.Equals(object)

FromRealObject(object)

Used internally to translate object across application boundaries

Declaration

cs-api-definition
public override void FromRealObject(object o)

Parameters

o

object

Overrides AutomationObject<FrameworkElement>.FromRealObject(object)

GetAttachedProperty<T>(string, string)

Get value of attached property.

Declaration

cs-api-definition
public T GetAttachedProperty<T>(string propertyOwner, string propertyName)

Parameters

propertyOwner

string

The type name of attached property owner.

propertyName

string

The name of the property.

Returns

T

The value of attached property.

GetAutomationProperty(string)

Declaration

cs-api-definition
public AutomationProperty GetAutomationProperty(string name)

Parameters

name

string

Returns

AutomationProperty

Implements IFrameworkElement.GetAutomationProperty(string)

GetChildTagIndex(FrameworkElement)

Given a child FrameworkElement of this element, return this child's tag index relative to this element. If the child has the same tag name as this element, it will not be counted.

Declaration

cs-api-definition
public int GetChildTagIndex(FrameworkElement child)

Parameters

child

FrameworkElement

The child to find the index of.

Returns

int

The child tag index else -1

GetChildren()

Get the children of this framework element.

Declaration

cs-api-definition
public ITargetElement[] GetChildren()

Returns

ITargetElement[]

The list of children

Implements ITargetElement.GetChildren()

GetControlTypeFromInterface(Type)

Get the loaded Xaml control type by given interface control type. Useful for sharing common Xaml (SL/Wpf) controls.

Declaration

cs-api-definition
public static Type GetControlTypeFromInterface(Type interfaceType)

Parameters

interfaceType

Type

The interface to look for.

Returns

Type

The loaded Xaml control type, or the default FrameworkElement type if nothing is found.

GetHashCode()

Calculates and returns the hashcode for this element.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

The hashcode.

Overrides object.GetHashCode()

GetHostParent()

Not implemented for Silverlight elements. Returns null.

Declaration

cs-api-definition
public ITargetElement GetHostParent()

Returns

ITargetElement

Implements ITargetElement.GetHostParent()

GetIdentifier(out string, out string)

Gets whether this framework element has an automationid set on it or name. If it does, it will return which one was found and its value. If both are found, AutomationId will be returned first.

Declaration

cs-api-definition
public bool GetIdentifier(out string name, out string value)

Parameters

name

string

value

string

Returns

bool

GetIntRectangle()

Gets the bounding rectangle of this element within the Silverlight app with integral coordinates

Declaration

cs-api-definition
public Rectangle GetIntRectangle()

Returns

Rectangle

The rectangle of this element

GetKnownControlTypes(TechnologyType)

Return all the known control types.

Declaration

cs-api-definition
public static List<string> GetKnownControlTypes(TechnologyType techType)

Parameters

techType

TechnologyType

Returns

List<string>

GetNextSibling()

Get the next sibling of this FrameworkElement.

Declaration

cs-api-definition
public FrameworkElement GetNextSibling()

Returns

FrameworkElement

The next sibling else null.

GetParent()

Get the Parent of this element.

Declaration

cs-api-definition
public ITargetElement GetParent()

Returns

ITargetElement

Return the parent object.

Implements ITargetElement.GetParent()

GetPrevSibling()

Get the previous sibling.

Declaration

cs-api-definition
public FrameworkElement GetPrevSibling()

Returns

FrameworkElement

GetProperties()

Reads and returns the specified property from this element.

Declaration

cs-api-definition
public Dictionary<string, string> GetProperties()

Returns

Dictionary<string, string>

The value of the specified property as a string.

GetProperty<T>(string)

Gets the property value by given name. Will be useful for common translators supporting different technologies (SL/Wpf).

Declaration

cs-api-definition
public T GetProperty<T>(string name)

Parameters

name

string

The property name.

Returns

T

The property return type.

Implements IFrameworkElement.GetProperty<T>(string)

GetPropertyTypeSafe(string)

Declaration

cs-api-definition
public object GetPropertyTypeSafe(string name)

Parameters

name

string

Returns

object

Implements IFrameworkElement.GetPropertyTypeSafe(string)

GetRealType()

Gets the real object type. This property returns string.empty on FrameworkElement and all subclasses that inherit from it.

Declaration

cs-api-definition
public override string GetRealType()

Returns

string

Overrides AutomationObject<FrameworkElement>.GetRealType()

GetRectangle()

Get the bounding rectangle of this element within this Silverlight App.

Declaration

cs-api-definition
public RectangleF GetRectangle()

Returns

RectangleF

The rectangle of this element

GetRectangle(FrameworkElement)

Get the bounding rectangle of this element relative to another element

Declaration

cs-api-definition
public RectangleF GetRectangle(FrameworkElement relativeTo)

Parameters

relativeTo

FrameworkElement

Returns

RectangleF

GetScreenRectangle()

Return the actual coordinates of this element in absolute screen coordinates taking into account the location of the overall plug-in on the page.

Declaration

cs-api-definition
public Rectangle GetScreenRectangle()

Returns

Rectangle

Screen coordinates of this element

Remarks

This will take into consideration any Transforms done on the element.

GetStringPresentation()

Return a string representation of this element

Declaration

cs-api-definition
public string GetStringPresentation()

Returns

string

Implements ITargetElement.GetStringPresentation()

GetUniqueHashCode()

Calculates and returns the hash code for this element.

Declaration

cs-api-definition
public int GetUniqueHashCode()

Returns

int

The hash code.

Implements ITargetElement.GetUniqueHashCode()

Highlight()

Highlight this element.

Declaration

cs-api-definition
public void Highlight()

Highlight(bool)

Highlight this element

Declaration

cs-api-definition
public void Highlight(bool clear)

Parameters

clear

bool

True to clear the highlight on the element.

InitKnownSilverlightControlTypes()

Declaration

cs-api-definition
public static void InitKnownSilverlightControlTypes()

InitKnownWpfControlTypes()

Declaration

cs-api-definition
public static void InitKnownWpfControlTypes()

InitKnownXamlControlTypes(Type)

Initialize all the known types

Declaration

cs-api-definition
public static void InitKnownXamlControlTypes(Type baseType)

Parameters

baseType

Type

InitializeMappings(MappingsCollection)

Initialize the Mappings collection. This method is called when the Mappings collection is accessed for the first time. It is then cached

Declaration

cs-api-definition
public virtual void InitializeMappings(MappingsCollection mappings)

Parameters

mappings

MappingsCollection

The mappings collection to populate

IsChild(FrameworkElement)

Checks if element passed in is a child of this framework element.

Declaration

cs-api-definition
public bool IsChild(FrameworkElement element)

Parameters

element

FrameworkElement

The child to check.

Returns

bool

True/False whether the element is a child.

IsHitTest()

Determines whether the element can be clicked/selected

Declaration

cs-api-definition
public virtual bool IsHitTest()

Returns

bool

IsHitTest(FrameworkElement, bool)

Determines whether [is hit test] [the specified relative parent].

Declaration

cs-api-definition
public virtual bool IsHitTest(FrameworkElement relativeParent, bool allowPartialVisibiltiy)

Parameters

relativeParent

FrameworkElement

The relative parent.

allowPartialVisibiltiy

bool

The allow partial visibiltiy.

Returns

bool

IsHitTest(bool)

Determines whether [is hit test] [the specified allow partial visibiltiy].

Declaration

cs-api-definition
public virtual bool IsHitTest(bool allowPartialVisibiltiy)

Parameters

allowPartialVisibiltiy

bool

The allow partial visibiltiy.

Returns

bool

KeyPress(Keys, int, int, int)

Simulate user key press specific to this element.

Declaration

cs-api-definition
public void KeyPress(Keys key, int holdFor, int delayBetweenRepetitions, int repeatCount)

Parameters

key

Keys

The key code for the key to press.

holdFor

int

How long to hold the key down, in milliseconds.

delayBetweenRepetitions

int

The time in milliseconds to wait between key presses.

repeatCount

int

The count of actions to repeat.

Match(IFindExpression)

Match this FrameworkElement against a specific find expression.

Declaration

cs-api-definition
public bool Match(IFindExpression findExpr)

Parameters

findExpr

IFindExpression

The find expression to match.

Returns

bool

Return true/false whether the expression matches.

Implements ITargetElement.Match(IFindExpression)

NextSibling(string)

Return the next sibling of this control of type.

Declaration

cs-api-definition
public FrameworkElement NextSibling(string controlType)

Parameters

controlType

string

The desired control type to match (i.e. 'Button', 'Calendar' ...etc)

Returns

FrameworkElement

The next sibling, else null if this control is the last sibiling.

NextSibling<T>()

The next sibling control of desired type.

Declaration

cs-api-definition
public T NextSibling<T>() where T : FrameworkElement

Returns

T

The next sibling.

Parent()

Get the parent framework element

Declaration

cs-api-definition
public FrameworkElement Parent()

Returns

FrameworkElement

Parent(string)

Get the parent control that matched the control type.

Declaration

cs-api-definition
public FrameworkElement Parent(string controlType)

Parameters

controlType

string

The desired control type to match (i.e. 'Button', 'Calendar' ...etc)

Returns

FrameworkElement

The parent object of specified type.

Parent(string, bool)

Get the parent control that matched the control type.

Declaration

cs-api-definition
public FrameworkElement Parent(string controlType, bool matchBaseType)

Parameters

controlType

string

The desired control type to match (i.e. 'Button', 'Calendar' ...etc)

matchBaseType

bool

If set to true, will match a parent control that inherits from 'controlType'

Returns

FrameworkElement

The parent object of specified type.

Parent<T>()

Get the parent control of this control that is of type T.

Declaration

cs-api-definition
public T Parent<T>() where T : IFrameworkElement

Returns

T

The parent control of specified type.

Implements IFrameworkElement.Parent<T>()

Remarks

This function will traverse up the VisualTree until it finds the desired type. This function will also match custom control type that inherit from type T. For explicit matchings use Parent(string)

PreviousSibling(string)

The previous sibling control of desired type.

Declaration

cs-api-definition
public FrameworkElement PreviousSibling(string controlType)

Parameters

controlType

string

The desired control type to match (i.e. 'Button', 'Calendar' ...etc)

Returns

FrameworkElement

The previous sibling.

PreviousSibling<T>()

The previous sibling control of specified type.

Declaration

cs-api-definition
public T PreviousSibling<T>() where T : FrameworkElement

Returns

T

Refresh()

Refresh this FrameworkElement within the VisualTree.

Declaration

cs-api-definition
public void Refresh()

Implements ITargetElement.Refresh()

RegisterElement(Type, string)

Associate a control type with a Xaml tag.

Declaration

cs-api-definition
public static void RegisterElement(Type controlType, string xamlTagName)

Parameters

controlType

Type

The control type.

xamlTagName

string

The xaml tag name.

ScrollToVisible()

Scrolls the web page so that this element is visible in the browser window

Declaration

cs-api-definition
public void ScrollToVisible()

Implements IFrameworkElement.ScrollToVisible()

ScrollToVisible(ScrollToVisibleType)

Scrolls the web page so that this element is visible in the browser window

Declaration

cs-api-definition
public void ScrollToVisible(ScrollToVisibleType scrollType)

Parameters

scrollType

ScrollToVisibleType

Where in the window the the element should be after scrolling

SetAttachedProperty<T>(string, string, T)

Set value of attached property.

Declaration

cs-api-definition
public void SetAttachedProperty<T>(string propertyOwner, string propertyName, T value)

Parameters

propertyOwner

string

The type name of attached property owner.

propertyName

string

The name of the property.

value

T

The value to be set.

SetClosingTag(ITargetElement)

Ignore for the base FrameworkElement. May be overriden in a derived class to provide additional functionality.

Declaration

cs-api-definition
public void SetClosingTag(ITargetElement closingElement)

Parameters

closingElement

ITargetElement

Whether or not to mark this element as a closing type of element.

Implements ITargetElement.SetClosingTag(ITargetElement)

SetDepth(int)

Set the depth of this framework element.

Declaration

cs-api-definition
public void SetDepth(int depth)

Parameters

depth

int

The depth to set it to.

Implements ITargetElement.SetDepth(int)

SetFindInfo(VisualFindInfo)

Declaration

cs-api-definition
public void SetFindInfo(VisualFindInfo findInfo)

Parameters

findInfo

VisualFindInfo

Implements IFrameworkElement.SetFindInfo(VisualFindInfo)

SetFocus()

Sets keyboard focus to this element

Declaration

cs-api-definition
public void SetFocus()

Implements IFrameworkElement.SetFocus()

SetParent(ITargetElement)

Set the parent object of this framework element.

Declaration

cs-api-definition
public void SetParent(ITargetElement parent)

Parameters

parent

ITargetElement

Implements ITargetElement.SetParent(ITargetElement)

SetProperty(string, object)

Sets the property value. Will be useful for common translators supporting different technologies (SL/Wpf).

Declaration

cs-api-definition
public void SetProperty(string name, object value)

Parameters

name

string

The property name.

value

object

The new property name.

Implements IFrameworkElement.SetProperty(string, object)

SetProxy(bool)

Declaration

cs-api-definition
public void SetProxy(bool isProxy)

Parameters

isProxy

bool

Implements IFrameworkElement.SetProxy(bool)

SetUid(string)

Declaration

cs-api-definition
public void SetUid(string uid)

Parameters

uid

string

Implements IFrameworkElement.SetUid(string)

SetXamlTag(string)

Set the Xaml tag name.

Declaration

cs-api-definition
public void SetXamlTag(string tag)

Parameters

tag

string

The tag name.

Implements IFrameworkElement.SetXamlTag(string)

ToRealObject()

Used internally to translate object across application boundaries

Declaration

cs-api-definition
public override object ToRealObject()

Returns

object

Overrides AutomationObject<FrameworkElement>.ToRealObject()

ToString()

Gets the string representation of this FrameworkElement object.

Declaration

cs-api-definition
public override string ToString()

Returns

string

Overrides object.ToString()

ToXml()

Gets an Xml formatted string that represents this element and all its children This Xml represents the VisualTree.

Declaration

cs-api-definition
public string ToXml()

Returns

string

The Xml string.

ValidateMouseLocationIfNeeded(Point)

Validate that the current location of the mouse is inside the browser window.

Declaration

cs-api-definition
public void ValidateMouseLocationIfNeeded(Point point)

Parameters

point

Point

The coordinates of the mouse.

Exceptions

InvalidOperationException

Thrown when the mouse is outside of the browser window.

ValidateType(Type, string)

Validate a control type with the control tag name.

Declaration

cs-api-definition
protected bool ValidateType(Type type, string tagName)

Parameters

type

Type

The control type.

tagName

string

The tag name to check

Returns

bool

True/False whether the tag name matches the type.

In this article
DefinitionConstructorsFrameworkElement()FieldsActualHeightPropertyActualWidthPropertyClipPropertyDataContextPropertyDesiredSizePropertyHeightPropertyHorizontalAlignmentPropertyIsHitTestVisiblePropertyMarginPropertyMaxHeightPropertyMaxWidthPropertyMinHeightPropertyMinWidthPropertyNamePropertyOpacityMaskPropertyOpacityPropertyRenderSizePropertyRenderTransformOriginPropertyRenderTransformPropertyTagPropertyVerticalAlignmentPropertyVisibilityPropertyWidthPropertyPropertiesAbsoluteSiblingTagIndexAbsoluteTagIndexActualHeightActualWidthApplicationAutomationIdChildrenClipComputedVisibilityDepthDesiredSizeEnableValidateMouseLocationFindHeightHorizontalAlignmentHostIsHitTestVisibleIsTestRegionIsVisibleMappingsMarginMaxHeightMaxWidthMinHeightMinWidthNameOpacityOpacityMaskParsedElementRenderSizeRenderTransformRenderTransformOriginTagNameIndexTechnologyTypeTextTextBlockContentTextLiteralContentToolTipTextUidUserVerticalAlignmentVisibilityWaitWidthXamlTagXamlTagBaseMethodsAddChildNode(ITargetElement)AnySibling(string)AnySibling<T>()As<T>()AssignReference(AutomationReference)Capture()CaptureImage()CastAs<T>()EnsureClickable()Equals(object)FromRealObject(object)GetAttachedProperty<T>(string, string)GetAutomationProperty(string)GetChildTagIndex(FrameworkElement)GetChildren()GetControlTypeFromInterface(Type)GetHashCode()GetHostParent()GetIdentifier(out string, out string)GetIntRectangle()GetKnownControlTypes(TechnologyType)GetNextSibling()GetParent()GetPrevSibling()GetProperties()GetProperty<T>(string)GetPropertyTypeSafe(string)GetRealType()GetRectangle()GetRectangle(FrameworkElement)GetScreenRectangle()GetStringPresentation()GetUniqueHashCode()Highlight()Highlight(bool)InitKnownSilverlightControlTypes()InitKnownWpfControlTypes()InitKnownXamlControlTypes(Type)InitializeMappings(MappingsCollection)IsChild(FrameworkElement)IsHitTest()IsHitTest(FrameworkElement, bool)IsHitTest(bool)KeyPress(Keys, int, int, int)Match(IFindExpression)NextSibling(string)NextSibling<T>()Parent()Parent(string)Parent(string, bool)Parent<T>()PreviousSibling(string)PreviousSibling<T>()Refresh()RegisterElement(Type, string)ScrollToVisible()ScrollToVisible(ScrollToVisibleType)SetAttachedProperty<T>(string, string, T)SetClosingTag(ITargetElement)SetDepth(int)SetFindInfo(VisualFindInfo)SetFocus()SetParent(ITargetElement)SetProperty(string, object)SetProxy(bool)SetUid(string)SetXamlTag(string)ToRealObject()ToString()ToXml()ValidateMouseLocationIfNeeded(Point)ValidateType(Type, string)
Not finding the help you need?
Contact Support