As this kind of image editing seems to be needing to happen on the UI thread, I was able to wrap my code inside a
await Window.Current.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {}
block, so now it looks like this:
private async void FilterListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
progressRing.IsActive = true;
try
{
await Window.Current.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
filteredImage = await FilterMethod.imageBW(originalImage, filteredImage);
}
}
catch
{
Debug.WriteLine("No items selected");
}
mainImage.Source = filteredImage;
progressRing.IsActive = false;
}