次の方法で共有


IXRFrameworkElement (Windows Embedded CE 6.0)

1/6/2010

This class represents a UI element located in the element tree that belongs to a visual host. It provides a framework of common APIs for creating or changing elements that comply with Silverlight for Windows Embedded layout system, enabling the layout system to arrange them on the screen at run time.

Syntax

class IXRFrameworkElement : public IXRUIElement

Methods

Method Description

IXRFrameworkElement::AddLoadedEventHandler

Attaches a delegate to the Loaded event for this framework element. When this framework element raises the Loaded event, this delegate will be invoked.

IXRFrameworkElement::AddSizeChangedEventHandler

Attaches a delegate to the SizeChanged event for this framework element. When the SizeChanged event is raised by this framework element, this delegate will be invoked.

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::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 can be used 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::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::SetCursor

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

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 can be used 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 characteristics that determine the vertical alignment of this framework element when it is displayed in a parent element, such as a panel or items control.

Remarks

IXRFrameworkElement extends IXRUIElement and adds the following capabilities:

  • Layout    Silverlight 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 retrieved by IXRFrameworkElement::GetMinWidth. 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 Silverlight derive from IXRFrameworkElement, either directly or through intermediate base classes such as IXRPanel or IXRControl.

When you create a custom control, it is uncommon to derive from IXRUIElement or IXRFrameworkElement directly. More commonly used base classes for derived custom classes are as follows:

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*, 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.

Inheritance Hierarchy

IXRDependencyObject

    IXRUIElement

        IXRFrameworkElement

            IXRBorder

            IXRControl

            IXRGlyphs

            IXRImage

            IXRItemsPresenter

            IXRPanel

            IXRPopup

            IXRShape

            IXRTextBlock

.NET Framework Equivalent

System.Windows.FrameworkElement

Requirements

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

See Also

Reference

Classes for UI Element Management