Default image directory on Windows

Download Sample Download the sample

This Universal Windows Platform platform-specific defines the directory in the project that image assets will be loaded from. It's consumed in XAML by setting the Application.ImageDirectory to a string that represents the project directory that contains image assets:

<Application xmlns=""

Alternatively, it can be consumed from C# using the fluent API:

using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;

The Application.On<Windows> method specifies that this platform-specific will only run on the Universal Windows Platform. The Application.SetImageDirectory method, in the Xamarin.Forms.PlatformConfiguration.WindowsSpecific namespace, is used to specify the project directory that images will be loaded from. In addition, the GetImageDirectory method can be used to return a string that represents the project directory that contains the application image assets.

The result is that all images used in an application will be loaded from the specified project directory.