Reputation: 12458
I am trying to apply styles to a control in WPF. And have noticed that some properties available in code behind arent available in XAML?
Why is this?
And can you help me with the following example:
<Style TargetType="RichTextBox">
<Setter Property="VerticalScrollBarVisibility" Value="Auto"></Setter>
<Setter Property="Background" Value="WhiteSmoke"></Setter>
<Setter Property="Foreground" Value="#515151"></Setter>
<Setter Property="Document.PageWidth" Value="300"></Setter>
</Style>
When trying to apply the PageWidth to the Document of the control, I get an exception that it is not accessible?
Thanks.
Upvotes: 0
Views: 117
Reputation: 185117
Setter.Property
is not a path, you cannot use it to set "properties of properties".
Upvotes: 1