如果我想对我的看法加以约束,则在我的SAML-Code资源中增加以下内容:
<Window.Resources>
<DataTemplate DataType="{x:Type MyViewModel}" >
<views:MyView />
</DataTemplate>
</Window.Resources>
是否有可能在C#-Code增加我的资源词典(概览、概览)的资源输入?
The following two lines create the key and add it to the dictonary:
DataTemplateKey key = new DataTemplateKey(typeof(MyViewModel));
View.WindowName.Resources.Add(key, value);
But how can I create the value from the MyView
which must have the type System.Windows.Baml2006.KeyRecord
?