SwipeControl Klasse

Definition

Stellt einen Container dar, der über eine einfache Touchinteraktion den Zugriff auf kontextbezogene Befehle und die Möglichkeit zum Aufrufen von Kontextbefehlen bietet.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

/// [Microsoft.UI.Xaml.MUXContractProperty(version=5)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class SwipeControl : ContentControl
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=5)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
class SwipeControl : ContentControl
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 65536)]
class SwipeControl : ContentControl
[Microsoft.UI.Xaml.MUXContractProperty(version=5)]
[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 SwipeControl : ContentControl
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
[Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=5)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
public class SwipeControl : ContentControl
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 65536)]
public class SwipeControl : ContentControl
Public Class SwipeControl
Inherits ContentControl
<SwipeControl .../>
Vererbung
SwipeControl
Attribute
Microsoft.UI.Xaml.MUXContractPropertyAttribute MarshalingBehaviorAttribute ThreadingAttribute VersionAttribute Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodNameAttribute ContractVersionAttribute

Beispiele

Tipp

Weitere Informationen, Entwurfsanleitungen und Codebeispiele finden Sie unter Wischen.

Die App WinUI 2-Katalog umfasst interaktive Beispiele für die meisten WinUI 2-Steuerelemente, -Features und -Funktionen. Rufen Sie die App aus dem Microsoft Store oder den Quellcode auf GitHub ab.

Hinweise

Die folgende Abbildung zeigt, wie ein kleiner Satz kontextbezogener Befehle über das SwipeControl-Steuerelement verfügbar gemacht werden kann.

Kontextbefehle, die über eine Wischgeste verfügbar gemacht werden

Steuerelementstil und -vorlage

Sie können die Standardvorlagen Style und ControlTemplate ändern, um dem Steuerelement ein eindeutiges Aussehen zu verleihen. Informationen zum Ändern des Stils und der Vorlage eines Steuerelements finden Sie unter XAML-Formatvorlagen. Der Standardstil, die Vorlage und die Ressourcen, die das Aussehen des Steuerelements definieren, sind in der generic.xaml Datei enthalten. Zu Entwurfszwecken generic.xaml wird mit dem NuGet-Paket WinUI (Microsoft.UI.Xaml) installiert. Standardmäßig ist der Speicherort \Users\<username>\.nuget\packages\microsoft.ui.xaml\<version>\lib\uap10.0\Microsoft.UI.Xaml\Themes\generic.xaml. Stile und Ressourcen aus verschiedenen WinUI-Versionen können unterschiedliche Werte aufweisen.

XAML enthält auch Ressourcen, mit denen Sie die Farben eines Steuerelements in verschiedenen visuellen Zuständen ändern können, ohne die Steuerelementvorlage zu ändern. Das Ändern dieser Ressourcen wird bevorzugt, um Eigenschaften wie Hintergrund und Vordergrund festzulegen. Weitere Informationen finden Sie im Abschnitt Leichtes Formatieren des Artikels XAML-Stile .

Konstruktoren

SwipeControl()

Initialisiert eine neue instance der SwipeControl-Klasse.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

Eigenschaften

BottomItems

Ruft die Elemente ab, die aufgerufen werden können, wenn das Steuerelement von unten nach oben gewischt wird, oder legt diese fest.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

BottomItemsProperty

Gibt die BottomItems-Abhängigkeitseigenschaft an.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

LeftItems

Ruft die Elemente ab, die aufgerufen werden können, wenn das Steuerelement von der linken Seite gewischt wird, oder legt diese fest.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

LeftItemsProperty

Gibt die LeftItems-Abhängigkeitseigenschaft an.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

RightItems

Ruft die Elemente ab, die aufgerufen werden können, wenn das Steuerelement von der rechten Seite gewischt wird, oder legt diese fest.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

RightItemsProperty

Gibt die RightItems-Abhängigkeitseigenschaft an.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

TopItems

Ruft die Elemente ab, die aufgerufen werden können, wenn das Steuerelement von oben nach unten gewischt wird, oder legt diese fest.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

TopItemsProperty

Gibt die TopItems-Abhängigkeitseigenschaft an.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

Methoden

Close()

Schließt das Wischsteuerelement.

Diese Dokumentation gilt für WinUI 2 für UWP (für WinUI in der Windows App SDK siehe Windows App SDK Namespaces).

Gilt für:

Weitere Informationen