Ejemplo n.º 1
0
        public NumberPickerDialog(Context context) : base(context)
        {
            SetContentView(Resource.Layout.number_picker_dialog);

            var _cancelButton = FindViewById <Button>(Resource.Id.buttonCancel);
            var _okButton     = FindViewById <Button>(Resource.Id.buttonSet);

            Picker = FindViewById <NumberPicker>(Resource.Id.numberPicker1);
            Picker.WrapSelectorWheel = false;

            _cancelButton.Click += (sender, args) => { Dismiss(); };

            _okButton.Click += (sender, args) =>
            {
                ValueSelected?.Invoke(this, Value);
                Dismiss();
            };
            Picker.ValueChanged += (sender, args) => { Value = args.NewVal; };
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a ListSubMenu instance
        /// </summary>
        public ListSubMenu()
        {
            InitializeComponent();
            DataContext         = this;
            BackgroundFillBrush = new SolidColorBrush(DefaultColors.InnerNormalColor);

            Tapped += (sender, args) =>
            {
                string selectedItem = SubMenuListView.SelectedValue as string;
                foreach (RadialMenuButton item in ListMenuItems)
                {
                    if (item.Label == selectedItem)
                    {
                        item.MenuSelected = true;
                        SelectedValue     = item.Value;
                    }
                    else
                    {
                        item.MenuSelected = false;
                    }
                }
                ValueSelected?.Invoke(this, args);
            };

            PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "Diameter")
                {
                    CenterButton.Top  = Diameter / 2 - CenterButton.Width / 2;
                    CenterButton.Left = Diameter / 2 - CenterButton.Width / 2;
                }
            };
            Loaded += (sender, e) =>
            {
                Draw();
            };
        }
Ejemplo n.º 3
0
 protected internal virtual void OnValueSelected(SelectedFilterEventArgs <T> args)
 {
     ValueSelected?.Invoke(this, args);
 }
Ejemplo n.º 4
0
        public MeterSubMenu()
        {
            InitializeComponent();
            LayoutRoot.DataContext = this;

            IsDraggable     = false;
            PointerPressed += (sender, args) =>
            {
                _isPressed = true;
                MeterLinePath.Visibility = Visibility.Visible;
                SelectedValueTextColor   = MeterLineColor;
                args.Handled             = true;
            };

            PointerReleased += (sender, args) =>
            {
                _isPressed = false;
                // hide the selection meter line
                MeterLinePath.Visibility = Visibility.Collapsed;
                // set the locked selection meter line
                var point = args.GetCurrentPoint(sender as UIElement);
                SetMeterPoint(point.Position, true, true);
                // set the locked on value
                LockedValue = SelectedValue;
                // modify the display text color
                SelectedValueTextColor = SelectedValueTextColor;
                ValueSelected?.Invoke(this, args);
            };
            PointerMoved += (sender, args) =>
            {
                if (!_isPressed)
                {
                    return;
                }

                var point = args.GetCurrentPoint(sender as UIElement);
                SetMeterPoint(point.Position, true, false);
                // indicate event handled
                args.Handled = true;
            };

            PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName != "Diameter")
                {
                    return;
                }

                Center            = new Point(Diameter / 2, Diameter / 2);
                CenterButton.Top  = Diameter / 2 - CenterButton.Width / 2;
                CenterButton.Left = Diameter / 2 - CenterButton.Width / 2;
            };

            Loaded += (sender, e) =>
            {
                // point meter to left initially
                SetMeterPoint(new Point(0, Diameter / 2), false, true);
                _setMeterPointForValue(LockedValue);
                _isLoaded = true;
                Draw();
            };
        }
Ejemplo n.º 5
0
        public override void Selected(UIPickerView pickerView, nint row, nint component)
        {
            SelectedRateBase = GetRateBaseAt(row);

            ValueSelected?.Invoke(this, EventArgs.Empty);
        }
 void CalendarDayButton_DoubleClick(object sender, RoutedEventArgs e)
 {
     ValueSelected?.Invoke();
 }