■ x:Key 속성에서 x:Static 태그 확장을 사용해 시스템 리소스를 재정의하는 방법을 보여준다.
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<StackPanel> <StackPanel.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.ActiveCaptionBrushKey}" Color="Red" /> </StackPanel.Resources> <Button HorizontalAlignment="Center" VerticalAlignment="Center" Margin="24" Foreground="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}"> Button with Red text </Button> </StackPanel> |