Esempio n. 1
0
            protected override void OnLayout(bool changed, int l, int t, int r, int b)
            {
                var valuePickerLeft   = PaddingLeft + (_combinedWidth - _valuePicker.MeasuredWidth) / 2;
                var valuePickerTop    = PaddingTop;
                var valuePickerRight  = valuePickerLeft + _valuePicker.MeasuredWidth;
                var valuePickerBottom = valuePickerTop + _valuePicker.MeasuredHeight;

                _valuePicker.Layout(valuePickerLeft, valuePickerTop, valuePickerRight, valuePickerBottom);

                var unitLabelLeft   = PaddingLeft + (_combinedWidth - _unitLabel.MeasuredWidth) / 2;
                var unitLabelBottom = MeasuredHeight - PaddingBottom;
                var unitLabelTop    = unitLabelBottom - _unitLabel.MeasuredHeight;
                var unitLabelRight  = unitLabelLeft + _unitLabel.MeasuredWidth;

                _unitLabel.Layout(unitLabelLeft, unitLabelTop, unitLabelRight, unitLabelBottom);
            }