Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "id" attribute is missing on AdaptiveText which is needed for lock screen notification #4933

Open
3 of 16 tasks
wherewhere opened this issue Sep 5, 2023 · 2 comments
Open
3 of 16 tasks
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior notifications 🔔

Comments

@wherewhere
Copy link

wherewhere commented Sep 5, 2023

Describe the bug

The way to show notification on lock screen is to set the id of the text in wide tile, such as

<binding template="TileWide">
    <text id="1">Line1</text>
    <text id="2">Line2</text>
    <text id="3">Line3</text>
</binding>

Which using TileContent is

TileWide = new TileBinding
{
    Content = new TileBindingContentAdaptive
    {
        Children =
        {
            new AdaptiveGroup
            {
                Children =
                {
                    new AdaptiveText
                    {
                        Id = 1,
                        Text = "Line1"
                    },
                    new AdaptiveText
                    {
                        Id = 2,
                        Text = "Line2"
                    },
                    new AdaptiveText
                    {
                        Id = 3,
                        Text = "Line3"
                    }
                }
            }
        }
    }
}

But the Id property is missing on AdaptiveText. I found that the Id property is exist in Element_AdaptiveText. So I change the ConvertToElement method and it works.

internal Element_AdaptiveText ConvertToElement()
{
    Element_AdaptiveText answer = new Element_AdaptiveText
    {
        Id = Id,
        Lang = Language,
        Style = HintStyle,
        Wrap = HintWrap,
        MaxLines = HintMaxLines,
        MinLines = HintMinLines,
        Align = HintAlign
    };

#if WINRT 
    answer.Text = XmlWriterHelper.GetBindingOrAbsoluteXmlValue(Bindings, AdaptiveTextBindableProperty.Text, Text); 
#else 
    answer.Text = Text?.ToXmlString(); 
#endif 
 
    return answer;
}

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

1. Write a tile notification.
2. Try to show it on lock screen.
3. There is no way to show but to write xml by my own...

Expected behavior

It should appeal on lock screen easily.

Screenshots

Cache_-5e2ff88e5797a1f0.jpg

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Windows 11, version 2209 (Build 22621)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

17.8.0 Preview 1.0

Device form factor

Desktop

Nuget packages

  • Microsoft.Toolkit.Uwp.Notifications (7.1.3)

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

@wherewhere wherewhere added the bug 🐛 An unexpected issue that highlights incorrect behavior label Sep 5, 2023
@ghost ghost added the needs triage 🔍 label Sep 5, 2023
@ghost
Copy link

ghost commented Sep 5, 2023

Hello wherewhere, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@wherewhere
Copy link
Author

@michael-hawker Lock Screen notification is still support on Windows 11. So I think this issue should be fixed.
IMG_20230909_232344.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior notifications 🔔
Projects
None yet
Development

No branches or pull requests

2 participants