SplitButton Klasse

Definition

Stellt eine Schaltfläche mit zwei Teilen dar, die separat aufgerufen werden können. Ein Teil verhält sich wie eine Standardschaltfläche und der andere ruft ein Flyout auf.

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

/// [Microsoft.UI.Xaml.MUXContractProperty(version=7)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
class SplitButton : 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=7)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
class SplitButton : 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 SplitButton : ContentControl
[Microsoft.UI.Xaml.MUXContractProperty(version=7)]
[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 SplitButton : 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=7)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
public class SplitButton : 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 SplitButton : ContentControl
Public Class SplitButton
Inherits ContentControl
Vererbung
SplitButton
Abgeleitet
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 Schaltflächen.

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

Steuerelementstil und -vorlage

Sie können den Standardstil und die ControlTemplate ändern, um dem Steuerelement ein eindeutiges Erscheinungsbild 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 Erscheinungsbild 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-Formatvorlagen .

Konstruktoren

SplitButton()

Initialisiert eine neue instance der SplitButton-Klasse.

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

Eigenschaften

Command

Ruft den Befehl ab, der beim Drücken dieser Schaltfläche aufgerufen wird, bzw. legt diesen fest.

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

CommandParameter

Ruft den Parameter ab, der an die Command-Eigenschaft übergeben werden soll, oder legt diesen fest.

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

CommandParameterProperty

Identifiziert die CommandParameter-Abhängigkeitseigenschaft.

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

CommandProperty

Identifiziert die Command-Abhängigkeitseigenschaft.

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

Flyout

Ruft das dieser Schaltfläche zugeordnete Flyout ab oder legt es fest.

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

FlyoutProperty

Identifiziert die Flyout-Abhängigkeitseigenschaft.

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

Ereignisse

Click

Tritt auf, wenn auf ein Schaltflächensteuerelement geklickt wird.

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

Gilt für:

Weitere Informationen