InfoBadge 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 a control for indicating notifications, alerts, new content, or to attract focus to an area within an app.
This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class InfoBadge : Control
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallback(enable=true)]
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodName(value="OnPropertyChanged")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class InfoBadge : Control
Public Class InfoBadge
Inherits Control
- Inheritance
-
InfoBadge
- Attributes
-
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackAttribute Microsoft.UI.Xaml.CustomAttributes.MUXPropertyChangedCallbackMethodNameAttribute ContractVersionAttribute MarshalingBehaviorAttribute ThreadingAttribute
Examples
Here's an example of a simple InfoBadge that's set to display the number of unread emails:
<InfoBadge x:Name="emailInfoBadge" Value="{x:Bind numUnreadMail}"/>
Remarks
If neither InfoBadge.Value and InfoBadge.IconSource InfoBadge.IconSource are set (default values are used), the InfoBadge defaults to a dot indicator. If both Value and IconSource properties are set, the Value property is used.
To hide the InfoBadge, set its Opacity property to 0.
Constructors
InfoBadge() |
Initializes a new instance of the InfoBadge class. This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces). |
Properties
IconSource |
Gets or sets the icon to be used in an InfoBadge. This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces). |
IconSourceProperty |
Identifies the InfoBadge.IconSource dependency property. This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces). |
TemplateSettings |
Provides calculated values that can be referenced as TemplatedParent sources when defining templates for an InfoBadge. Not intended for general use. This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces). |
TemplateSettingsProperty |
Identifies the InfoBadgeTemplateSettings dependency property. This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces). |
Value |
Gets or sets the integer to be displayed in a numeric InfoBadge. This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces). |
ValueProperty |
Identifies the InfoBadge.Value dependency property. This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces). |
Applies to
See also
反馈
提交和查看相关反馈