AppNotificationImageCrop Enum
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.
Specifies the cropping options for an image in an AppNotification.
public enum class AppNotificationImageCrop
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract, 65536)]
enum class AppNotificationImageCrop
C#
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract), 65536)]
public enum AppNotificationImageCrop
var value = Microsoft.Windows.AppNotifications.Builder.AppNotificationImageCrop.default
Public Enum AppNotificationImageCrop
- Inheritance
-
AppNotificationImageCrop
- Attributes
Name | Value | Description |
---|---|---|
Default | 0 | Default. No cropping. |
Circle | 1 | Circular cropping. |
The following example demonstrates setting an inline image in the XML payload for an app notification.
C#
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.SetInlineImage(new Uri("ms-appx:///Images/InlineImage.png"), AppNotificationImageCrop.Circle, "Alternate text")
.BuildNotification();
AppNotificationManager.Default.Show(notification);;
The resulting XML payload:
XML
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Notification text.</text>
<image src='ms-appx:///Images/InlineImage.png' alt='Alternate text' hint-crop='circle'/>
</binding>
</visual>
</toast>
Set the crop for an app notification image in the call to AppNotificationBuilder.SetInlineImage).
Produkt | Versiounen |
---|---|
Windows App SDK | 1.2, 1.3, 1.4, 1.5, 1.6 |