LayoutContext Klasse

Definition

Stellt die Basisklasse für ein Objekt dar, das die Kommunikation zwischen einem angefügten Layout und seinem Hostcontainer erleichtert.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe die Windows App SDK Namespaces).

public ref class LayoutContext : 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 LayoutContext : 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 LayoutContext : 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 LayoutContext : 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 LayoutContext : DependencyObject
Public Class LayoutContext
Inherits DependencyObject
Vererbung
LayoutContext
Abgeleitet
Attribute
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute ContractVersionAttribute

Beispiele

Tipp

Weitere Informationen, Entwurfsleitlinien und Codebeispiele finden Sie unter Layout.

Die WinUI 3-Katalog- und WinUI 2-Katalog-Apps umfassen interaktive Beispiele für die meisten WinUI 3- und WinUI 2-Steuerelemente, -Features und -Funktionen.

Wenn sie bereits installiert sind, öffnen Sie sie, indem Sie auf die folgenden Links klicken: WinUI 3-Katalog oder WinUI 2-Katalog.

Wenn sie nicht installiert sind, können Sie den WinUI 3-Katalog und den WinUI 2-Katalog aus dem Microsoft Store herunterladen.

Sie können auch den Quellcode für beide von GitHub abrufen (verwenden Sie denmain-Branch für WinUI 3 und den Branchwinui2 für WinUI 2).

Hinweise

Sie sollten die LayoutContext-Klasse nicht direkt verwenden. Verwenden Sie stattdessen abgeleitete Klassen, NonVirtualizationLayoutContext oder VirtualizingLayoutContext.

Eigenschaften

LayoutState

Dient zum Abrufen oder Festlegen eines Objekts, das den Zustand eines Layouts darstellt.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe die Windows App SDK Namespaces).

LayoutStateCore

Implementiert das Verhalten von LayoutState in einem abgeleiteten oder benutzerdefinierten LayoutContext.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI im Windows App SDK, siehe die Windows App SDK Namespaces).

Gilt für:

Weitere Informationen