【发布时间】:2018-01-17 04:50:46
【问题描述】:
我想在 Xamarin Forms 中创建一个模板变量,就像我们可以在 Angular 中创建的那样。
比如this
【问题讨论】:
标签: xamarin xamarin.forms template-variables
我想在 Xamarin Forms 中创建一个模板变量,就像我们可以在 Angular 中创建的那样。
比如this
【问题讨论】:
标签: xamarin xamarin.forms template-variables
您可以使用 x:Name 来命名视图,然后使用 x:Reference 在其他地方引用它。像下面这样:
<Slider x:Name="slider"
Maximum="360" />
<Label BindingContext="{x:Reference slider}"
Text="{Binding Value, StringFormat='The angle is {0:F0} degrees'}" />
Here is an article 展示了这种和其他绑定技术。
【讨论】: