contentpresenter - Content Presenter in WPF exception -
exception using content presenter
type 'system.windows.controls.contentpresenter' not have content property. specify name of property set, or add contentpropertyattribute or typeconverterattribute on type.
below xaml
<combobox.itemtemplate> <datatemplate> <stackpanel orientation="horizontal"> <checkbox ischecked="{binding isselected}" content="{binding series}" width="50" verticalalignment="center" checked="checkseries_checked" unchecked="checkseries_unchecked" /> </stackpanel> </datatemplate> </combobox.itemtemplate> </combobox>
you trying set contentpresenter.content
property implicitly setting inner text of contentpresenter
control:
<contentpresenter> mycontent </contentpresenter>
instead should set this
<contentpresenter content="mycontent" />
you're getting error because contentpresenter
doesn't have contentproperty
attribute tells xaml parser set inner text value content
property.
Comments
Post a Comment