ToggleMenuFlyoutItem
ToggleMenuFlyoutItem
ToggleMenuFlyoutItem
ToggleMenuFlyoutItem
Class
Definition
Represents an item in a MenuFlyout that a user can change between two states, checked or unchecked.
public : class ToggleMenuFlyoutItem : MenuFlyoutItem, IToggleMenuFlyoutItempublic class ToggleMenuFlyoutItem : MenuFlyoutItem, IToggleMenuFlyoutItemPublic Class ToggleMenuFlyoutItem Inherits MenuFlyoutItem Implements IToggleMenuFlyoutItem// This API is not available in Javascript.
<ToggleMenuFlyoutItem .../>
-or-
<ToggleMenuFlyoutItem>text</ToggleMenuFlyoutItem>
- Inheritance
-
ToggleMenuFlyoutItemToggleMenuFlyoutItemToggleMenuFlyoutItemToggleMenuFlyoutItem
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited properties
Inherited events
Inherited methods
Remarks
There are three elements that you can use to compose the menu items in a MenuFlyout control: MenuFlyoutItem , ToggleMenuFlyoutItem, and MenuFlyoutSeparator. You can use these in any combination.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about modifying a control's style and template, see Styling controls. The default style, template, and resources that define the look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP<SDK version>\Generic folder from a Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml includes resources that you can use to modify the colors of a control in different visual states without modifying the control template. In apps that target this software development kit (SDK) or later, modifying these resources is preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling section of the Styling controls article.
This table shows the resources used by the ToggleMenuFlyoutItem control.
| Resource key | Description |
|---|---|
| ToggleMenuFlyoutItemBackground | Background color of entire control bounds at rest |
| ToggleMenuFlyoutItemBackgroundPointerOver | Background color on hover |
| ToggleMenuFlyoutItemBackgroundPressed | Background color when pressed |
| ToggleMenuFlyoutItemBackgroundDisabled | Background color when disabled |
| ToggleMenuFlyoutItemForeground | Text color at rest |
| ToggleMenuFlyoutItemForegroundPointerOver | Text color on hover |
| ToggleMenuFlyoutItemForegroundPressed | Text color when pressed |
| ToggleMenuFlyoutItemForegroundDisabled | Text color when disabled |
| ToggleMenuFlyoutItemCheckGlyphForeground | Color of selected check mark |
| ToggleMenuFlyoutItemCheckGlyphForegroundPointerOver | Color of selected check mark on hover |
| ToggleMenuFlyoutItemCheckGlyphForegroundPressed | Color of selected check mark when pressed |
| ToggleMenuFlyoutItemCheckGlyphForegroundDisabled | Color of selected check mark when disabled |
Constructors
ToggleMenuFlyoutItem() ToggleMenuFlyoutItem() ToggleMenuFlyoutItem() ToggleMenuFlyoutItem()
Initializes a new instance of the ToggleMenuFlyoutItem class.
public : ToggleMenuFlyoutItem()public ToggleMenuFlyoutItem()Public Sub New()// This API is not available in Javascript.
Properties
IsChecked IsChecked IsChecked IsChecked
Gets or sets whether the ToggleMenuFlyoutItem is checked.
public : PlatForm::Boolean IsChecked { get; set; }public bool IsChecked { get; set; }Public ReadWrite Property IsChecked As bool// This API is not available in Javascript.
<ToggleMenuFlyoutItem IsChecked="bool" />
- Value
- PlatForm::Boolean bool bool bool
true if the ToggleMenuFlyoutItem is checked; false if the ToggleMenuFlyoutItem is unchecked. The default is false.
IsCheckedProperty IsCheckedProperty IsCheckedProperty IsCheckedProperty
Identifies the IsChecked dependency property.
public : static DependencyProperty IsCheckedProperty { get; }public static DependencyProperty IsCheckedProperty { get; }Public Static ReadOnly Property IsCheckedProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the IsChecked dependency property.