0
ContentPresenter에 컨트롤을 추가 한 다음 실행하려고하지만 추가 한 컨트롤이 테마를 적용하지 않습니다.WPF 테마 및 동적 컨트롤
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/PocGraphDataTemplates.xaml" />
</ResourceDictionary.MergedDictionaries>
또한
난 뒤에 코드에서 스타일을 설정하려고했습니다가 작동하지 않습니다 :
Theres는이 XAML 파일에서 테마를 참조 코드는 제어가 정적 모든 것을했다
this.graphLayout.Content = analyzerViewModel.AnalyzedLayout = new PocGraphLayout()
{
LayoutAlgorithmType = "FR"
};
ResourceDictionary rd = new ResourceDictionary();
rd.Source = new Uri("Resources/PocGraphDataTemplates.xaml", UriKind.Relative);
analyzerViewModel.AnalyzedLayout.Style = new Style(typeof(PocGraphLayout));
analyzerViewModel.AnalyzedLayout.Style.Resources.MergedDictionaries.Add(rd);
잘 처리 됨 :
<ViewModel:PocGraphLayout x:Name="graphLayout"
Graph="{Binding Path=Graph}"
LayoutAlgorithmType="{Binding Path=LayoutAlgorithmType}"
Sample:LayoutManager.ManagedLayout="True"
OverlapRemovalAlgorithmType="FSA"
HighlightAlgorithmType="Simple" />
아이디어가 있으십니까?
추신. 나는 wpf에 초보자입니다.