Replies: 2 comments 1 reply
-
@hxhgxy I'll try to provide an answer: Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" This will explicitly set the foreground to brush defined by the Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=TextElement.Foreground)}" This will bind the foreground to the brush which is set on the nearest parent element of type The latter approach will typically be used in places where the control/element you're currently setting properties for does not really know (or care) about the context it resides in, but it just needs to "follow along". And it may be worth pointing out that |
Beta Was this translation helpful? Give feedback.
-
Thank you! I try to learn and understand your codes on theme management. It is still too difficult to me. |
Beta Was this translation helpful? Give feedback.
-
Can I ask what is the difference between two Foreground for text below?
Would they have different behavior in Theme changing? Light <---> Dark
Beta Was this translation helpful? Give feedback.
All reactions