KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
If I assign a piece of text to the Content property of a ContentPresenter , a TextBlock control is generated by the ContentPresenter at render time to contain that text. If I create a style that applies to TextBlock properties and assign it to that ContentPresenter , the does not appear to apply to the implicitly generated TextBlock s. <Style x:Key="SampleStyle"> <Setter Property="TextBlock.TextWrapping" Value="Wrap"/> </Style> <ContentPresenter Content="This is a Test piece of text." Style="{StaticResource SampleStyle}"/> Is there a way to apply this style successfully to the autogenerated TextBlock s short of applying it to all TextBlock s (e.g. declaring style as TargetType="TextBlock" with no Key )?
Tags (comma-separated)
Save Edits
Cancel