.net - How to pass System.Type in ObjectDataProvider.MethodParameters? -
i want bind function parameter textblock in xaml. function parameter has type system.type
. how notate complex object methodparameter in xaml?
<window.resources> <objectdataprovider x:key="mykey" objecttype="{x:type mytype}" methodname="mymethod"> <objectdataprovider.methodparameters> <system:int32>123</system:int32> <!-- e.g. primitive type parameter --> <mynamespace:mycustomtype>what comes here?</mynamespace:mycustomtype> </objectdataprovider.methodparameters> </objectdataprovider> </window.resources> [...] <textblock text="{binding source={staticresource mykey}}" />
use x:type
:
<objectdataprovider x:key="mykey" objecttype="{x:type mytype}" methodname="mymethod"> <objectdataprovider.methodparameters> <system:int32>123</system:int32> <x:type typename="mynamespace:mycustomtype"></x:type> </objectdataprovider.methodparameters> </objectdataprovider>
Comments
Post a Comment