Description
Description
In a .NET MAUI app you can follow the .NET Android approach to handling localized images and it works correctly. On iOS/MacCat you can follow the platform approach to handling localized images and it works with a workaround (see #16734).
Windows is equally mysterious. If you place your localized images, in locale folders, in the root of your MAUI project then image localization works:
This isn't great though. But placing them in Platform/Windows doesn't work:
Similarly, placing them in Platform/Windows/Assets/Images doesn't work, which I'd hoped would work due to it being the UWP approach.
However, it's possible to make it work. Place your localized images in Platforms/Windows/Assets/Images (or whatever you want to call your images folder):
Those images will get copied to bin/.../win10-x64/AppX/Platforms/Windows/Assets/Images
, which means to retrieve them in XAML you'll need to specify the path:
<Image Source="{OnPlatform flag.png, WinUI=Platforms/Windows/Assets/Images/flag.png}" />
So while this works I'd label it a papercut because the behaviour on one platform is different to the other platforms, where you don't have to worry about the path to the images.
Version with bug
7.0.92
Is this a regression from previous behavior?
No, this is something new
Affected platforms
Windows