From 5a025ecb5a0e5a39a6be0fb72b1d439cbb1e5aa8 Mon Sep 17 00:00:00 2001 From: where where Date: Mon, 25 Aug 2025 19:42:39 +0800 Subject: [PATCH] Add Id property for AdaptiveText and AdaptiveImage --- components/Notifications/src/Adaptive/AdaptiveImage.cs | 6 ++++++ components/Notifications/src/Adaptive/AdaptiveText.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/components/Notifications/src/Adaptive/AdaptiveImage.cs b/components/Notifications/src/Adaptive/AdaptiveImage.cs index 7d8687ffb..1ef042d09 100644 --- a/components/Notifications/src/Adaptive/AdaptiveImage.cs +++ b/components/Notifications/src/Adaptive/AdaptiveImage.cs @@ -16,6 +16,11 @@ public sealed class AdaptiveImage IAdaptiveChild, IAdaptiveSubgroupChild { + /// + /// Gets or sets the id of this image. Use for lock screen notification. + /// + public int? Id { get; set; } + /// /// Gets or sets the desired cropping of the image. /// Supported on Tiles since RTM. Supported on Toast since Anniversary Update. @@ -81,6 +86,7 @@ internal Element_AdaptiveImage ConvertToElement() { Element_AdaptiveImage image = BaseImageHelper.CreateBaseElement(this); + image.Id = Id; image.Crop = HintCrop; image.RemoveMargin = HintRemoveMargin; image.Align = HintAlign; diff --git a/components/Notifications/src/Adaptive/AdaptiveText.cs b/components/Notifications/src/Adaptive/AdaptiveText.cs index 6aa4df70b..8a07ea157 100644 --- a/components/Notifications/src/Adaptive/AdaptiveText.cs +++ b/components/Notifications/src/Adaptive/AdaptiveText.cs @@ -25,6 +25,11 @@ public sealed class AdaptiveText /// public BindableString Text { get; set; } + /// + /// Gets or sets the id of this text. Use for lock screen notification. + /// + public int? Id { get; set; } + /// /// Gets or sets the target locale of the XML payload, specified as a BCP-47 language tags /// such as "en-US" or "fr-FR". The locale specified here overrides any other specified @@ -108,6 +113,7 @@ internal Element_AdaptiveText ConvertToElement() { var answer = new Element_AdaptiveText() { + Id = Id, Lang = Language, Style = HintStyle, Wrap = HintWrap,