WPF 응용 프로그램에서 테스트 했을 때에는
아무 문제 없이 잘돌아가던 프로그램이..
UserControl로 변경하여 Winform에서 호스팅하면...
리소스가 없는 문제가 발생한다.
Application.Current 개체가 null..........ㅠㅠ
구글링 결과 간단하였다.
Application 개체 한번 생성해주고 리소스 불러오면 된다.
/// <summary> /// Winform에서 호스팅시 Resource Load한다. /// </summary> private void EnsureApplicationResources() { if (Application.Current == null) { new Application(); ResourceDictionary skinDict = Application.LoadComponent(new Uri(@"/DVCONSOLE;component/Resources\Skins\xxxx.xaml", UriKind.Relative)) as ResourceDictionary; Application.Current.Resources = skinDict; } }
|
'.Net > WPF' 카테고리의 다른 글
디자인 모드 체크 (0) | 2013.06.04 |
---|---|
WPF ScrollViewer Thumbnail (0) | 2013.05.28 |
[MVVMLight] Window 창 띄우기 및 MSG 전송 (0) | 2013.03.20 |
컬렉션 뷰 작업 (ICollectionView 선택 개체 변경) (0) | 2013.03.18 |
DataGrid RowHeader값 Number 설정하기 (0) | 2013.03.07 |