property value inheritance
It is perfectly fine to write something like that:
<StackPanel TextBlock.FontWeight="Bold">
<Label>dasdas</Label>
<Grid>
<Label>dfasdass</Label>
</Grid>
</StackPanel>
But why it is not possible to set fontweight only for labels by writing Label.FontWeight="Bold" ?
Thank you for help in advance
Re: property value inheritance
Quote:
Originally Posted by
yoyosh
But why it is not possible to set fontweight only for labels by writing Label.FontWeight="Bold" ?
Post the xaml code for what you have in mind. It's not clear where you would like to set the Label.FontWeight property.
Re: property value inheritance
Hi,
I would like to set it exactly instead of "TextBlock.FontWeight="Bold"", so to have:
<StackPanel Label.FontWeight="Bold">
<Label>dasdas</Label>
<Grid>
<Label>dfasdass</Label>
</Grid>
</StackPanel>
Re: property value inheritance
Create a style for the Label and set it in there.
Re: property value inheritance
That`s ok, but why it is not possible with Label while it is possible with TextBlock?
Re: property value inheritance
TextBlock is a FrameworkElement, Label is a ContentControl.
They are derived from different classes, thus different DependencyProperty's.