c# - Get an Image that is the child of a Panel -
i have panel , added in window itemspanel of itemscontrol
<grid x:name="outergrid" > <itemscontrol itemssource="{binding imagesourcescollection}"> <itemscontrol.itemspanel> <itemspaneltemplate> <view:custompanel /> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemtemplate> <datatemplate> <image source="{binding}"/> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol> </grid>
as can see in panel show series of images. works right, want access images inside custompanel change source 1 of them.
if access them elements of base.children obtain contentpresenter, i.e.:
var element = base.children[i]; //<- contentpresenter
so question is: how can image?
one solution, since know position of image, element @ position. prefer else because not clean , if have other images moving around can source of troubles.
thanks!
i found out if want change source of image (and case), can change property content of contentpresenter. not sure how access image though...
Comments
Post a Comment