uwp TileContent с TileBackgroundImage не работает - PullRequest
0 голосов
/ 17 июня 2020

В моем приложении UWP я использую два изображения для проверки свойства HintOverLay с фоновым изображением. Но на плитке не отображается изображение или наложение изображения. Я использую Maps.xml пример официального Визуализатора уведомлений . Их пример отлично работает в моей системе. Но следующий код не работает:

Вопрос : Что мне может не хватать и как мы можем заставить это работать. Я проверил, что файлы untitled3.png и untitled4.png существуют в папке Assets/Apps/. Я использую VS2019 - ver16.6.2 на Windows10 Pro -ver1903?

ОБНОВЛЕНИЕ :

Скриншот изображений junk1.png и junk2.png [размер: 100x100 пикселей ]

enter image description here

enter image description here

Снимок экрана обозревателя решений :

enter image description here

Код :

.....
.....
TileContent content = new TileContent()
{
    Visual = new TileVisual()
    {
        TileMedium = new TileBinding()
        {
            Content = new TileBindingContentAdaptive()
            {
                BackgroundImage = new TileBackgroundImage()
                {
                    Source = "Assets/Apps/junk1.png"
                },
                PeekImage = new TilePeekImage()
                {
                    Source = "Assets/Apps/junk2.jpg",
                    HintOverlay = 20
                }
            }
        },
        TileWide = new TileBinding()
        {
            Content = new TileBindingContentAdaptive()
            {
                BackgroundImage = new TileBackgroundImage()
                {
                    Source = "Assets/Apps/junk1.png"
                },
                PeekImage = new TilePeekImage()
                {
                    Source = "Assets/Apps/junk2.png",
                    HintOverlay = 20
                }
            }
        }
    }
};

// Create the tile notification
TileNotification notification = new TileNotification(content.GetXml());
TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);

// Send the notification to the primary tile
TileUpdateManager.CreateTileUpdaterForApplication().Update(notification);
...