![](/img/trans.png)
[英]How to use value of a C# variable in XAML in Xamarin.Forms?
[英]Xamarin.Forms: Binding to Entire BindingConext in C# (not XAML)
將項目綁定到 XAML 中的整個BindingContext
的語法是{Binding.}
。
我如何在 C# 中做同樣的事情?
C# 等效於{Binding.}
是省略綁定路徑,例如.Bind(Button.CommandParameter)
<Button Command="{Binding ButtonCommand}" CommandParameter ="{Binding .}"
using Xamarin.Forms.Markup;
// ...
new Button().Bind(Button.CommandProperty, "ButtonCommand").Bind(Button.CommandParameterProperty)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.