2011-11-14 4 views

답변

1

가능한 모든 테마를 디자인 할 때 별도의 파일로 정의하는 것이 좋습니다. 그런 다음 런타임에 테마를 변경하면 컨트롤의 전경색이 변경됩니다.

this simple post을 참조하십시오. 런타임시 테마를 변경하는 방법이 설명되어 있습니다.

//declare a resource dictionary 
ResourceDictionary skin = new ResourceDictionary(); 
//load your theme 
skin.Source = new Uri(@”ThemeName.xaml”, UriKind.Relative); 
Application.Current.Resources.MergedDictionaries.Clear(); 
//apply it 
Application.Current.Resources.MergedDictionaries.Add(skin); 

테마에 대해 자세히 알고 싶으면 this page으로 이동하십시오. 테마를 다운로드하고 볼 수있는 9 개의 샘플 테마가 있습니다.

+0

당신은 몇 가지 예제 코드를 제공 할 수 있을까요? 감사. –