Below is the XAML I'm using to create a list of vehicles in this instance -- one of the vehicles is the "default" vehicle and a star image is show next to it if the default setting is set to "true". This all works fine and dandy.
However, for light/dark themes, I'd like to change the color of the image from white to black depending on the theme. However I can't figure out how to do this. I've tried programatically creating an XAML resource and adding it but that doesn't seem to work. I've also tried naming the image (as you can see below "iLPNS" however, I can't access this in my code behind because (I'm assuming) it doesn't really exist until the listbox contains items.
Does anyone have any ideas how I can do this?
<controls:PivotItem Header="vehicles" Name="piLPNS">
<Grid>
<TextBlock Text="A list of the vehicles associated with your account are listed below. To make changes to your vehicle list using the buttons below or by tapping the desired vehicle." Margin="12,0,0,0" TextWrapping="Wrap" />
<ListBox Height="300" HorizontalAlignment="Left" Margin="0,135,0,0" Name="lbLPNList" VerticalAlignment="Top" Width="456" SelectionChanged="lbLPNList_SelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ListBox.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal" Height="60" Width="432" HorizontalAlignment="Center">
<StackPanel Orientation="Vertical" Height="60" Width="40" Margin="12,0,0,0">
<StackPanel Orientation="Horizontal" Height="45">
<Image Name="iLPNS" Source="/Parkmobile;component/Resources/Icons/Icon.Star.Resource.png" Margin="0,5,0,0" Visibility="{Binding Default, Converter={StaticResource VisibilityConverter}}" Height="36" Width="36" HorizontalAlignment="Right"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Height="60">
<StackPanel Orientation="Horizontal" Height="45">
<TextBlock Margin="10,0,0,0" FontSize="36" Text="{Binding ShortDisplay}" />
</StackPanel>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</controls:PivotItem>