Listview 在Xamarin forms代码隐藏中使用2个值为visible属性设置绑定
我有一个包含标签的列表。列表视图在XAML文件中声明,其中列表的数据单元在cs文件中以编程方式生成。我需要基于这两个字段值绑定列表中此标签的visible属性 Xaml代码:Listview 在Xamarin forms代码隐藏中使用2个值为visible属性设置绑定,listview,xamarin.forms,multibinding,Listview,Xamarin.forms,Multibinding,我有一个包含标签的列表。列表视图在XAML文件中声明,其中列表的数据单元在cs文件中以编程方式生成。我需要基于这两个字段值绑定列表中此标签的visible属性 Xaml代码: <ListView x:Name="lvItemSigns" HasUnevenRows="True" SeparatorVisibility="Default" SeparatorColor="Gray"> 我可以使用1个值绑定visible属性,如何使用2个值来完成?在模型上创建只读属性 public b
<ListView x:Name="lvItemSigns" HasUnevenRows="True" SeparatorVisibility="Default" SeparatorColor="Gray">
我可以使用1个值绑定visible属性,如何使用2个值来完成?在模型上创建只读属性
public bool Visible
{
get
{
// test for multiple conditions here
return PropertyA && PropertyB;
}
}
每当设置任何依赖属性的值时,您还需要引发PropertyChangedVisible。这是否正确?私人布尔(u deleteimiticovisible);;public bool DeleteItemIconVisible{get{return RecordID==0&&SyncError;}set{{u DeleteItemIconVisible=value;OnPropertyChangedDeleteItemIconVisible;}}@Jasonyou不需要集合,也没有理由使用私有变量,因为get从未使用过它
public bool Visible
{
get
{
// test for multiple conditions here
return PropertyA && PropertyB;
}
}