Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

XFLab and ButtonGroup

$
0
0

@SKall I have not understand how to use Button Group Control.
It has a Item property that you can use to add Buttons... but BindingContext? Can I set it to a List? or they (Item and BindingContext) have different meanings?

Because I have a Item with "On" and "Off", and a BindingContext = foo;

I would like that when foo is null, the "IsVisibleProperty" is set to false and viceversa. I've create this

        buttonGroupInOut.SetBinding (ButtonGroup.IsVisibleProperty, ".", BindingMode.Default, new IsTerminaleSelected ());

with

public class IsTerminaleSelected : IValueConverter
{

    #region IValueConverter implementation

    public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {

        return value != null;

    }

    public object ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new NotImplementedException ();
    }

    #endregion
}

But it does not work... If I put a breakpoint in Convert Method

                return value != null;

it is never reached.

Alessandro


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>