Hello,
Welcome to Microsoft Q&A!
Based on this document, it mentions you need to subscribe the MapChanged event on ResourceContext.QualifierValues to respond to changes in system settings. When your HighContrast changes, this event will be triggered, then you can reload your images with the help of the default ResourceContext. For example:
.cs:
public MainPage()
{
this.InitializeComponent();
// Subscribe to the event that's raised when a qualifier value changes.
var qualifierValues = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().QualifierValues;
qualifierValues.MapChanged += new Windows.Foundation.Collections.MapChangedEventHandler<string, string>(QualifierValues_MapChanged);
}
private async void QualifierValues_MapChanged(IObservableMap<string, string> sender, IMapChangedEventArgs<string> @event)
{
var dispatcher = this.myImageXAMLElement.Dispatcher;
if (dispatcher.HasThreadAccess)
{
this.RefreshUIImages();
}
else
{
await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => this.RefreshUIImages());
}
}
private void RefreshUIImages()
{
//The folder naming: \Assets\Images\contrast-standard\1.jpg
var namedResource = Windows.ApplicationModel.Resources.Core.ResourceManager.Current.MainResourceMap[@"Files/Assets/Images/1.jpg"];
this.myImageXAMLElement.Source = new Windows.UI.Xaml.Media.Imaging.BitmapImage(namedResource.Uri);
}