【发布时间】:2017-09-20 00:27:43
【问题描述】:
我有这个 XAML
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding TapGestureForUpdateCategories, Source={x:Reference MainPage}}" CommandParameter="false" />
</Label.GestureRecognizers>
我的 ViewModel 中的这段代码
public Command TapGestureForUpdateCategories => new Command(val =>
{
App.DB.UpdateAllCategoryGroups(val);
App.DB.UpdateAllCategory(val);
});
我正在尝试从 XAML 传递参数 true 或 false,但在命令 C# 代码中,在 val 下有一行说“无法从对象转换为布尔值”。谁能帮我解决这个问题?
【问题讨论】:
标签: xamarin xamarin.forms