androidxamarinmvvmcross

Can I combine multiple property in visibility binding with MvvmCross?


I have two Boolean properties in my ViewModel. Can I use combination of both properties to set visibility?

Something like

local:MvxBind="Visibility Visibility(BoolProperty1 && BoolProperty2)"

Solution

  • You can use one of the ValueCombiners MvvmCross provides:

    local:MvxBind="Visibility Visibility(And(BoolProperty1, BoolProperty2))"
    

    You can read more about value combiners in the MvvmCross documentation: https://www.mvvmcross.com/documentation/fundamentals/value-combiners