Reputation: 8823
What's the difference between.
<TextBox Text="{local:BindingResourceExtension MyBinding}" >
<TextBox.Style>
<StaticResourceExtension ResourceKey="style" />
</TextBox.Style>
</TextBox>
and
<TextBox Text="{local:BindingResourceExtension MyBinding}" Style="{StaticResource style}"/>
Which should be preferred in XAML?
Upvotes: 0
Views: 626
Reputation: 723729
There is no difference. The curly brace syntax is designed specifically so you can use markup extensions within attribute values without having to resort to specifying the properties as child elements like in the first example. So, naturally, the curly brace syntax is preferred in those situations.
Upvotes: 1