How to set visibility for ProgressBar in android MvvmCross Xamarin

后端 未结 1 545
自闭症患者
自闭症患者 2021-01-28 20:39

I am trying to set visibility for ProgressBar as GONE.


In XML



        
相关标签:
1条回答
  • 2021-01-28 20:58

    You need to create a custom value converter for Visibility or you can use Visibility plugin

    public class MyVisibilityValueConverter : MvxBaseVisibilityValueConverter<bool>
    {
        protected override MvxVisibility Convert(string value, object parameter, CultureInfo culture)
        {
            return (value ==true) ? MvxVisibility.Visible : MvxVisibility.Collapsed;
        }
    }
    

    xml:

    local:MvxBind="Visibility ProgressVisibility,Converter=MyVisibility
    

    More info here

    0 讨论(0)
提交回复
热议问题