Share via


DynamicResourceHandler 확장

확장은 DynamicResourceHandler 테마에 사용할 수 있는 구성 IDynamicResourceHandler 을 지원하는 일련의 확장 메서드를 제공합니다.

확장은 다음 메서드를 제공합니다.

DynamicResource

이 메서드는 DynamicResource 구현하는 IDynamicResourceHandler컨트롤의 속성을 설정합니다DynamicResource.

다음 예제에서는 ResourceDictionaryTextColor바인딩합니다Label.TextColorProperty.

new Label().DynamicResource(Label.TextColorProperty, "TextColor");

DynamicResources

이 메서드는 DynamicResources 구현하는 IDynamicResourceHandler컨트롤에서 여러 DynamicResource 속성을 설정합니다.

다음 예제에서는 ResourceDictionary 키에 바인딩 Label.TextColorProperty 하고 ResourceDictionaryFontFamilyTextColor에도 바인딩합니다Label.FontFamilyProperty.

new Label().DynamicResources(Label.TextColorProperty, "TextColor", 
                                Label.FontFamilyProperty, "FontFamily");