Layout Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the base class for an object that sizes and arranges child elements for a host.
public ref class Layout : DependencyObject
/// [Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class Layout : DependencyObject
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 65536)]
class Layout : DependencyObject
[Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
public class Layout : DependencyObject
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 65536)]
public class Layout : DependencyObject
Public Class Layout
Inherits DependencyObject
- Inheritance
- Derived
- Attributes
-
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute ContractVersionAttribute
Remarks
You should not use or inherit from the Layout class directly. Instead, inherit from its derived classes, NonVirtualizingLayout or VirtualizingLayout.
Provided concrete layout classes are StackLayout and UniformGridLayout.
Properties
Dispatcher |
Always returns |
DispatcherQueue |
Gets the |
IndexBasedLayoutOrientation |
Gets the orientation, if any, in which items are laid out based on their index in the source collection. |
Methods
Arrange(LayoutContext, Size) |
Positions child elements and determines a size for a container UIElement. Container elements that support attached layouts should call this method from their layout override implementations to form a recursive layout update. |
ClearValue(DependencyProperty) |
Clears the local value of a dependency property. (Inherited from DependencyObject) |
CreateDefaultItemTransitionProvider() | |
GetAnimationBaseValue(DependencyProperty) |
Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject) |
GetValue(DependencyProperty) |
Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject) |
InitializeForContext(LayoutContext) |
Initializes any per-container state the layout requires when it is attached to a UIElement container. |
InvalidateArrange() |
Invalidates the arrange state (layout) for all UIElement containers that reference this layout. After the invalidation, the UIElement will have its layout updated, which occurs asynchronously. |
InvalidateMeasure() |
Invalidates the measurement state (layout) for all UIElement containers that reference this layout. |
Measure(LayoutContext, Size) |
Suggests a DesiredSize for a container element. A container element that supports attached layouts should call this method from their own MeasureOverride implementations to form a recursive layout update. The attached layout is expected to call the Measure for each of the container’s UIElement children. |
ReadLocalValue(DependencyProperty) |
Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject) |
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback) |
Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance. (Inherited from DependencyObject) |
SetIndexBasedLayoutOrientation(IndexBasedLayoutOrientation) |
Sets the value of the |
SetValue(DependencyProperty, Object) |
Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject) |
UninitializeForContext(LayoutContext) |
Removes any state the layout previously stored on the UIElement container. |
UnregisterPropertyChangedCallback(DependencyProperty, Int64) |
Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback. (Inherited from DependencyObject) |
Events
ArrangeInvalidated |
Occurs when the arrange state (layout) has been invalidated. |
MeasureInvalidated |
Occurs when the measurement state (layout) has been invalidated. |