c# - Binding a control's x:Name -
when add
<textblock text="{binding settingname}" textwrapping="wrap" margin="10,-2,10,0" style="{staticresource phonetextsubtlestyle}" /> everuthing ok. when
<textblock x:name="{binding settingtextblockname}" text="{binding settingname}" textwrapping="wrap" margin="10,-2,10,0" style="{staticresource phonetextsubtlestyle}" /> constructor breaking.
but need different names in elements.
x:name special property. matter of fact it's not property @ all, it's attribute maps name or id property of element x:name. binding works when applied dependencyproperty, cannot work on x:name. must set manually.
if want distinguish between objects in runtime, can set tag attribute, tolerates everything.
more on x:name: http://msdn.microsoft.com/en-us/library/ms752290.aspx
Comments
Post a Comment