【发布时间】:2018-01-04 09:26:07
【问题描述】:
我从 Xamarin 官方页面尝试了this simple example,其中包含一个模板绑定,例如:
<ControlTemplate x:Key="TealTemplate">
<Grid>
<Label Text="{TemplateBinding Parent.HeaderText}" />
<Label Text="{TemplateBinding Parent.FooterText}" />
</Grid>
</ControlTemplate>
但是,我总是通过将示例代码复制到 Visual Studio 来得到错误。:
谁能给我一个简短的例子,如何从 ControlTemplate 中绑定到模板化控件的属性,无论是绑定上下文还是控件本身?
【问题讨论】:
标签: xaml xamarin xamarin.forms templatebinding