I'm developing a .NET MAUI App. It has an MAUIIcon as AppIcon, so far so good.
But how is it possible to display this icon in an normal XAML contentPage?
I tried to use ImageSource.FromFile("AppIcon.png") but that doesent work. Even as trying to get it as embedded ressource.
Best regards
You can copy the AppIcon image to the
\Resource\Imagesfolder and set its build action as MauiImage.And then use it in the XAML:
Update:
If you don't want to copy the file. You can try to use it by edit the following code in the Project's .csproj file:
After this, you don't have to copy the app icon file. You can use it directly.
Note: You can see the default MauiIcon contains two file: appicon.svg and appiconfg.svg. So if you use the default
Source="appicon.png", you will only seem a purple image.