내가 가진 :DataTemplate의 관련 dataType을 프로그래밍 방식으로 액세스하는 방법?
<DataTemplate DataType="{x:Type svgEdit:UserControlSvgEditModel}">
<svgEdit:UserControlSvgEdit />
</DataTemplate>
내가 프로그램 유형을 얻으려면 : svgEdit : UserControlSvgEdit
을 내가 않습니다
// Here the obj Type is the key to the resource, it works but
var key = new System.Windows.DataTemplateKey(obj.GetType());
var dataTemplate = (DataTemplate)DockSite.FindResource(key);
// I don't know how to get the DataTemplate associated type ????
var tc = dataTemplate.Template as TemplateContent;
하지만 찾을 수없는 방법 관련 유형을 검색 할?
참고 : 나는
"관련 유형"은 무엇을 의미합니까? 'Type' 참조 값을 얻으려고하십니까? 그렇다면 어떤 유형을 구체적으로 결정하려고합니까? 그렇지 않다면 무엇을 결정하려고합니까? –