WPF Style - value based on another control's property
Posted
by David Ward
on Stack Overflow
See other posts from Stack Overflow
or by David Ward
Published on 2010-05-28T10:10:00Z
Indexed on
2010/05/28
10:11 UTC
Read the original article
Hit count: 620
Is it possible to set the BorderBrush property in a style, to the value of the BorderBrush property of an instance of another control?
Something like:
<Style x:Key="{x:Type Controls:TimePicker}" TargetType="Controls:TimePicker">
<Setter Property="BorderBrush" Value="[ElementName=txtText Property=BorderBrush]"/>
</Style>
The reason for this is that I'm using Infragistics controls that have a "Theme" that can be changed and I want my custom control to change border style at the same time.
© Stack Overflow or respective owner