I have 2 Label
s in a StackPanel
and set a Foreground
color to both of them... The second one shows as black, when it shouldn't.
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="4" Grid.Row="0" Width="Auto" Margin="0,0,20,0"> <Label Content="{lex:LocText CGI, Suffix=:}" Foreground="#FFE0E0E0" FontSize="24" VerticalAlignment="Bottom" Margin="0,0,0,10" HorizontalAlignment="Right" /> <Label Content="{Binding Cgi}" ContentStringFormat="{}{0}%" Foreground="#FFE0E0E0" FontSize="24" VerticalAlignment="Bottom" Margin="0,0,0,10" HorizontalAlignment="Right" /> </StackPanel>
Is there something I'm doing wrong?
Then, from the toolbar select the textblock and name the application name then select the buttons and place it on the screen and then set the labels on the screen. Then, set the label properties such as changing the background color to the corresponding color. And keep the label's content as blank.
I checked your XAML, it works fine - e.g. both labels have a gray foreground.
My guess is that you have some style which is affecting the way it looks...
Try moving your XAML to a brand-new window and see for yourself... Then, check if you have any themes or styles (in the Window.Resources
for instance) which might be affecting the labels...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With