AppNotificationImageCrop Enumeration
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Gibt die Zuschneideoptionen für ein Bild in einem AppNotification-an.
public enum class AppNotificationImageCrop
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract, 65536)]
enum class AppNotificationImageCrop
[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
- Vererbung
-
AppNotificationImageCrop
- Attribute
Felder
Name | Wert | Beschreibung |
---|---|---|
Circle | 1 | Kreisförmiges Zuschneiden. |
Default | 0 | Vorgabe. Kein Zuschneiden. |
Beispiele
Im folgenden Beispiel wird das Festlegen eines Inlinebilds in der XML-Nutzlast für eine App-Benachrichtigung veranschaulicht.
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.SetInlineImage(new Uri("ms-appx:///Images/InlineImage.png"), AppNotificationImageCrop.Circle, "Alternate text")
.BuildNotification();
AppNotificationManager.Default.Show(notification);;
Die resultierende XML-Nutzlast:
<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>
Hinweise
Legen Sie den Zuschnitt für ein App-Benachrichtigungsbild im Aufruf von AppNotificationBuilder.SetInlineImagefest.