Beispiel #1
0
        internal RadioButton(
            RadioButtonPicker radioButtonGroup,
            RadioButtonItem radioButtonItem)
        {
            if (null == radioButtonGroup)
            {
                throw new ArgumentNullException(nameof(radioButtonGroup));
            }

            if (null == radioButtonItem)
            {
                throw new ArgumentNullException(nameof(radioButtonItem));
            }

            this._textFormat = new TextFormat()
            {
                FontSize            = 10.0f,
                HorizontalAlignment = LayoutAlignment.Center,
                VerticalAlignment   = LayoutAlignment.End,
            };

            this.Size  = new Size(72, 60);
            this.Scale = IsUncheckedScale;

            this.RadioButtonPicker = radioButtonGroup;
            this.RadioButtonItem   = radioButtonItem;

            this.GestureRecognizer = new TapGestureRecognizer(this);

            radioButtonItem.PropertyChanged += MenuItem_PropertyChanged; // TODO: Matching detach event handler
        }
Beispiel #2
0
        internal void Add(
            RadioButtonItem radioButtonItem)
        {
            if (null == radioButtonItem)
            {
                throw new ArgumentNullException(nameof(radioButtonItem));
            }

            var radioButton = new RadioButton(this, radioButtonItem);

            radioButton.Command = new Command((o) => OnButtonClicked(o as RadioButton));
            this._buttonsLayout.Children.Add(radioButton, DockRegion.Left);
        }