Well, setting this up in xml is pretty small, consider switching to Spring. Configuring code in a format, configure your spring context in C # / a>.
In any case, to do this in xml, you use the .net shared collection constructors. For example, it List<T>takes a constructor IList<T>, so you can customize the list of strings as follows:
<object id="list1" type="System.Collections.Generic.List<string>">
<constructor-arg>
<list element-type="string">
<value>abc</value>
<value>def</value>
</list>
</constructor-arg>
</object>
, xml <, < xml. Spring.net docs.
Dictionary<string, System.Collections.Generic.List<string>> , :
<object id="dic1" type="System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>">
<constructor-arg>
<dictionary key-type="string" value-type="System.Collections.Generic.List<string>">
<entry key="keyToList1" value-ref="list1" />
<entry key="keyToList2" value-ref="list2" />
</dictionary>
</constructor-arg>
</object>
, , :
<object id="dic0" type="System.Collections.Generic.Dictionary<string, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>>">
<constructor-arg>
<dictionary key-type="string" value-type="System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>">
<entry key="keyToDic1 " value-ref="dic1" />
</dictionary>
</constructor-arg>
</object>
:
<object id="MyObject" type="MyNamespace.MyClass, MyAssembly">
<property name="ContextMenuModel" ref="dic0" />
</object>
, xml .