Share via


IXRFrameworkElement (Compact 2013)

3/28/2014

This class represents a UI element that can be located in the element tree that belongs to a visual host.

Syntax

class IXRFrameworkElement : public IXRUIElement

Inheritance Hierarchy

IXRUIElement

     IXRFrameworkElement

          IXRBorder

          IXRControl

          IXRGlyphs

          IXRImage

          IXRItemsPresenter

          IXRPanel

          IXRPopup

          IXRShape

          IXRTextBlock

Methods

Method

Description

IXRFrameworkElement::AddLayoutUpdatedEventHandler

Attaches a delegate to the LayoutUpdated event for this framework element.

IXRFrameworkElement::AddLoadedEventHandler

Attaches a delegate to the Loaded event for this framework element.

IXRFrameworkElement::AddSizeChangedEventHandler

Attaches a delegate to the SizeChanged event for this framework element.

IXRFrameworkElement::ApplyTemplate

Loads the relevant control template so that its parts can be referenced.

IXRFrameworkElement::FindName

Retrieves the element that has the specified name.

IXRFrameworkElement::GetActualHeight

Retrieves the displayed height of this framework element.

IXRFrameworkElement::GetActualWidth

Retrieves the displayed width of this framework element.

IXRFrameworkElement::GetActualX

Retrieves the actual x-coordinate of this UI element, in pixels.

IXRFrameworkElement::GetActualY

Retrieves the actual y-coordinate of this UI element, in pixels.

IXRFrameworkElement::GetCursor

Retrieves the cursor that is displayed while the mouse pointer is over this framework element.

IXRFrameworkElement::GetDataContext

Retrieves the data-source object that provides the data context for an element that participates in data binding.

IXRFrameworkElement::GetFlowDirection

Retrieves the direction that text and other UI elements flow within any parent element that controls their layout.

IXRFrameworkElement::GetHeight

Retrieves the height of this framework element.

IXRFrameworkElement::GetHorizontalAlignment

Retrieves the characteristics that determine the horizontal alignment of this framework element when it is displayed inside a parent element, such as a panel or items control.

IXRFrameworkElement::GetMargin

Retrieves information about the width of the frame that surrounds this framework element.

IXRFrameworkElement::GetMaxHeight

Retrieves the maximum height of this framework element.

IXRFrameworkElement::GetMaxWidth

Retrieves the maximum width of this framework element.

IXRFrameworkElement::GetMinHeight

Retrieves the minimum height of this framework element.

IXRFrameworkElement::GetMinWidth

Retrieves the minimum width of this framework element.

IXRFrameworkElement::GetParent

Returns the parent object of this object in the visual tree.

IXRFrameworkElement::GetResources

Retrieves the locally defined resource dictionary.

IXRFrameworkElement::GetStyle

Retrieves an IXRStyle instance that is applied to this framework element when it is displayed.

IXRFrameworkElement::GetTag

Retrieves an arbitrary string value that you can use to store custom information about this framework element.

IXRFrameworkElement::GetTriggers

Retrieves the collection of triggers that initiate different kinds of animations for this element.

IXRFrameworkElement::GetVerticalAlignment

Retrieves the characteristics that determine the vertical alignment of this framework element when it is displayed inside a parent element, such as a panel or items control.

IXRFrameworkElement::GetWidth

Retrieves the width of this framework element.

IXRFrameworkElement::RemoveLayoutUpdatedEventHandler

Removes a delegate from the LayoutUpdated event for this framework element.

IXRFrameworkElement::RemoveLoadedEventHandler

Removes a delegate from the Loaded event for this framework element.

IXRFrameworkElement::RemoveSizeChangedEventHandler

Removes a delegate from the SizeChanged event for this framework element.

IXRFrameworkElement::SetBinding

Attaches a data binding to an IXRFrameworkElement object, using the provided binding object.

IXRFrameworkElement::SetCursor

Sets the cursor that is displayed while the mouse pointer is over this framework element.

IXRFrameworkElement::SetDataContext

Sets the data-source object that provides the data context for an element that participates in data binding.

IXRFrameworkElement::SetFlowDirection

Sets the direction that text and other UI elements flow within any parent element that controls their layout.

IXRFrameworkElement::SetHeight

Sets the height of this framework element.

IXRFrameworkElement::SetHorizontalAlignment

Sets the characteristics that determine the horizontal alignment of this framework element when it is displayed inside a parent element, such as a panel or items control.

IXRFrameworkElement::SetMargin

Sets the width of the frame that surrounds this framework element.

IXRFrameworkElement::SetMaxHeight

Sets the maximum height of this framework element.

IXRFrameworkElement::SetMaxWidth

Sets the maximum width of this framework element.

IXRFrameworkElement::SetMinHeight

Sets the minimum height of this framework element.

IXRFrameworkElement::SetMinWidth

Sets the minimum width of this framework element.

IXRFrameworkElement::SetStyle

Sets an IXRStyle instance that is applied to this framework element when it is displayed.

IXRFrameworkElement::SetTag

Sets an arbitrary string value that you can use to store custom information about this framework element.

IXRFrameworkElement::SetVerticalAlignment

Sets the characteristics that determine the vertical alignment of this framework element when it is displayed inside a parent element, such as a panel or items control.

IXRFrameworkElement::SetWidth

Sets the new width of this framework element.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

IXRFrameworkElement provides a framework of common APIs for creating or changing elements that comply with the XAML for Windows Embedded layout system, enabling the layout system to arrange them on the screen at run time.

IXRFrameworkElement extends IXRUIElement and adds the following capabilities:

  • Layout   XAML for Windows Embedded implements its layout system to recognize elements that derive from IXRFrameworkElement. It also reads several different properties that are defined at that level, such as the MinWidth property that IXRFrameworkElement::GetMinWidth retrieves. It provides extensible methods for layout behavior that both panel objects and controls can override in their class implementations.
  • Object-lifetime events   It is frequently useful to know when the element is first loaded-when it is attached to an element tree that connects to the root of the visual tree. You can attach delegates to the Loaded event, providing useful hooks for C++ code-behind operations, such as adding child elements or setting properties on child elements just before they are used.

Many common classes in XAML for Windows Embedded derive from IXRFrameworkElement, either directly or through intermediate base classes such as IXRPanel or IXRControl.

To position an object derived from IXRFrameworkElement on the screen, you can specify its offsets by calling IXRFrameworkElement::SetMargin. Or, you can set its attached properties Canvas.Left and Canvas.Top by calling IXRDependencyObject::SetAttachedProperty(const WCHAR*, const WCHAR*, float).

The element tree provides access to IXRFrameworkElement objects. The visual host provides access to the root of the element tree. After you create a visual host for your application, you can retrieve an IXRFrameworkElement pointer to its root element by calling IXRVisualHost::GetRootElement.

IXRFrameworkElement provides support for several basic scenarios, but lacks some extended features that are desirable for creating UI in XAML. Many of these aspects are instead present on IXRControl or other immediate subclasses of IXRFrameworkElement.

If you find you need to create a class instance, use an IXRFrameworkElementPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

.NET Framework Equivalent

System.Windows.FrameworkElement

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for UI Element Management