How to get the background in setter?
how to get the background of a control in the setter. Eg. How to the get the Background of TextBox in the Setter?
<Setter TargetName="Border" Property="Background" Value="{TemplateBinding Background}"/>
This statement will give an error "Expression type is note valid style value". Is there any way to g开发者_StackOverflow社区et the background property in the setter?
Try,
<Style TargetType={x:Type TextBox}>
<Setter Property="Background" Value="Azure" />
</Style>
Is this what you are trying ??
Sudarsan Srinivasan
Update related to the first comment on this answer
If you want to do ElementBinding,
Sudarsan Srinivasan
精彩评论