Compartir a través de


IXRLayoutInformation::GetLayoutSlot (Compact 2013)

3/28/2014

This method retrieves the layout slot, or bounding box, that contains the specified element.

Syntax

virtual HRESULT GetLayoutSlot(
    IXRFrameworkElement *pElement, 
    XRRect *pLayoutSlot
) = 0;

Parameters

  • pElement
    [in] Pointer to an object that derives from IXRFrameworkElement and that specifies the element whose layout slot you require.
  • pLayoutSlot
    [out] Pointer to an XRRect structure that represents the bounding box that contains pElement.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

The layout slot is the bounding box that defines the area that an element occupies. The origin of the bounding box (coordinate 0, 0) appears within the parent element. The following image shows the dimensions of a parent panel, its child element, and the layout slot that contains the child.

Gg159885.28e31555-3c5a-4772-884e-ea75368cc432(en-us,WinEmbedded.80).jpg

If the element is smaller than the layout slot, it is positioned inside based on its alignment properties. The following image shows two of the same element, each inside an IXRGrid panel. The element on the right has Margin properties that are set to 10.

Gg159885.ab30dc34-0e25-45d6-baba-db95de197c9f(en-us,WinEmbedded.80).jpg

If the element is larger than the layout slot, it is clipped. You can retrieve the visible area of that clipping by calling IXRLayoutInformation::GetLayoutClip. The following image shows two of the same element, each inside an IXRCanvas panel. The element on the right has Margin properties that are set to 10, positioning the element outside its layout slot.

Gg159885.4a358ca8-d6d0-41a1-91b6-6d1585ff06c2(en-us,WinEmbedded.80).jpg

.NET Framework Equivalent

System.Windows.Controls.Primitives.LayoutInformation.GetLayoutSlot

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRLayoutInformation