Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

i use the Microsoft.Toolkit.Uwp.Notifications for handling Toast Notifications.
With the methods .AddAppLogoOverride and .AddHeroImage i can include images.

This methods are expecting the image path as URI.
Using a file path from the file system is working fine.

But i want to use images (.PNG files) that i store as Resources in my project so that i don't have to care that the users have to install the image files on their file system.

Can anyone please tell me the correct syntax for an Image which is stored as resource in my project? For example the File Name is "LDNotifyHero.png". Resource type is Image. Build Action is "Resource".

Thank you and best regards
Emanuel

What I have tried:

I tried:

//tcb.AddAppLogoOverride(new Uri(PROGRAM_PATH + "LDNotifyIcon.png"), ToastGenericAppLogoCrop.Circle);
//tcb.AddAppLogoOverride(new Uri("pack://application:,,,/Images/LDNotifyIcon.png"), ToastGenericAppLogoCrop.Circle);
//tcb.AddAppLogoOverride(new Uri("pack://application:,,,/ReferencedAssembly;LDNotifyIcon/ResourceFile.xaml"), ToastGenericAppLogoCrop.Circle);
//tcb.AddAppLogoOverride(new Uri("pack://application:,,,/RebootNotifier;component/LDNotifyIcon.png", UriKind.Absolute), ToastGenericAppLogoCrop.Circle);
//tcb.AddAppLogoOverride(new Uri("/RebootNotifier;component/LDNotifyIcon.png", UriKind.Relative), ToastGenericAppLogoCrop.Circle);
//tcb.AddAppLogoOverride(new Uri("ms-appx:///Assets/Images/LDNotifyIcon.png"), ToastGenericAppLogoCrop.Circle);
tcb.AddAppLogoOverride(new Uri("ms-appx:///RebootNotifier/Resources/LDNotifyIcon.png"), ToastGenericAppLogoCrop.Circle);


The first line works (...PROGRAM_PATH....) - as mentioned i used the file path in the file system.
But the following lines do not work.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900