R
Rolf Welskes
Hello,
because there are no manged news groups for windows presentation foundation,
I was told to
send my question here.
Problem:
Look at the following xaml:
<Grid Background="Beige" Margin="84,79,215,83" Name="grid01"
TextBlock.FontSize="24.0">
<Button Height="23" HorizontalAlignment="Left" Margin="20,22,0,0"
Name="button1" VerticalAlignment="Top" Width="75">Button</Button>
</Grid>
I set over the attached property FontSize the FontSize for the grid (which
as it's own has no fontsize.).
Now this fontsize is inherented to all childs, in this sample to the button.
This works fine.
Now the same with Foreground:
<Grid Background="Beige" Margin="84,79,215,83" Name="grid01"
TextBlock.Foreground="Red">
<Button Height="23" HorizontalAlignment="Left" Margin="20,22,0,0"
Name="button1" VerticalAlignment="Top" Width="75">Button</Button>
</Grid>
It's all the same, Foreground also is an inherentable DependencyProperty.
BUT: this does not work.
So, It's not possible to set forground for all elements in a grid.
What is the reason.
Thank you for any help.
Best Regards
Rolf Welskes
because there are no manged news groups for windows presentation foundation,
I was told to
send my question here.
Problem:
Look at the following xaml:
<Grid Background="Beige" Margin="84,79,215,83" Name="grid01"
TextBlock.FontSize="24.0">
<Button Height="23" HorizontalAlignment="Left" Margin="20,22,0,0"
Name="button1" VerticalAlignment="Top" Width="75">Button</Button>
</Grid>
I set over the attached property FontSize the FontSize for the grid (which
as it's own has no fontsize.).
Now this fontsize is inherented to all childs, in this sample to the button.
This works fine.
Now the same with Foreground:
<Grid Background="Beige" Margin="84,79,215,83" Name="grid01"
TextBlock.Foreground="Red">
<Button Height="23" HorizontalAlignment="Left" Margin="20,22,0,0"
Name="button1" VerticalAlignment="Top" Width="75">Button</Button>
</Grid>
It's all the same, Foreground also is an inherentable DependencyProperty.
BUT: this does not work.
So, It's not possible to set forground for all elements in a grid.
What is the reason.
Thank you for any help.
Best Regards
Rolf Welskes