For everyone who follows my comments above, I had to switch from ImageBrush to image directly (xaml below)
<Button Tag="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="-10,20,0,0" BorderThickness="0" Width="105" Height="102" Click="ShowKioskOnMap_Click"> <Image Source="../images/arrow.png" Width="55" Height="53" ImageOpened="Image_ImageOpened"/> </Button>
Further in the page builder that I use, I looked at the topic to prevent any problems from occurring when the state of the application is restored, for example, from a phone call (or just downloading the image for the first time)
InitializeComponent(); theme = ""; //field level var (could make it dark by default if needed) if ((Visibility)App.Current.Resources["PhoneDarkThemeVisibility"] == Visibility.Visible) { theme = "dark"; } else { theme = "light"; }
And I had to implement the following in my open event to switch to the topic
private void Image_ImageOpened(object sender, RoutedEventArgs e) { var brush = (sender as Image); if (brush.Stretch == Stretch.Uniform) { if (theme == "light") brush.Source = new BitmapImage(new Uri("../images/arrowLight.png", UriKind.Relative)); brush.Stretch = Stretch.Fill; } }
source share