xml - XAML xmldataprovider shows on runtime but not on designer -
i have following code(this code copied online example , sample not working) in order preview usercontrol during design time:
<stackpanel orientation="horizontal" width="200"> <stackpanel.resources> <xmldataprovider x:key="myxmlprovider" xpath="mydata"> <x:xdata> <mydata xmlns=""> <mydataitem mystring="test data 1" myint="32" mycolor="#ffaabbcc"/> <mydataitem mystring="test data 2" myint="42" mycolor="red"/> </mydata> </x:xdata> </xmldataprovider> <datatemplate x:key="mytemplate"> <stackpanel background="{binding xpath=@mycolor}"> <textblock text="{binding xpath=@myint}"/> <textblock text="{binding xpath=@mystring}"/> </stackpanel> </datatemplate> </stackpanel.resources> <listbox itemtemplate="{staticresource mytemplate}" itemssource="{binding /mydata/mydataitem, mode=oneway, source={staticresource myxmlprovider}}" horizontalalignment="stretch" verticalalignment="stretch" horizontalcontentalignment="stretch" verticalcontentalignment="stretch" width="100" height="100"/>
this code works during runtime not through designer. possible preview data on usercontrol during design time using xmldataprovider , dummy xml data? using vs professional 2015.
thanks
Comments
Post a Comment