Exemplo n.º 1
0
 public PropertySerializer(string name, object value, ValueChanged handler)
 {
     Name = name;
     mValue = value;
     Handle = handler;
 }
Exemplo n.º 2
0
 protected void OnValueChanged() => ValueChanged?.Invoke(this, EventArgs.Empty);
Exemplo n.º 3
0
 private void RaiseValueChanged()
 {
     ValueChanged?.Invoke(this, EventArgs.Empty);
 }
 public void SetBarcode(string value)
 {
     Value = value;
     ValueChanged?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 5
0
 protected virtual void OnValueChanged(ValueEventArgs <T> e) => ValueChanged?.Invoke(this, e);
Exemplo n.º 6
0
        public ReadOnlyDependencyPropertyValueEntry(IDependencyPropertyValueEntry source)
        {
            this.source = source;

            source.ValueChanged += (sender, e) => ValueChanged.Raise(this, e);
        }
Exemplo n.º 7
0
 /// <inheritdoc/>
 protected override Task OnInternalValueChanged(TValue value)
 {
     return(ValueChanged.InvokeAsync(value));
 }
Exemplo n.º 8
0
 private void maxDelay_TimeSpanControl_ValueChanged(object sender, EventArgs e)
 {
     ValueChanged?.Invoke(this, e);
 }
Exemplo n.º 9
0
 private void OnCheckChanged(object sender, EventArgs e)
 {
     nudValue.Enabled = chkbOpt.Checked;
     lbUnit.Enabled   = chkbOpt.Checked;
     ValueChanged?.Invoke(this, e);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Handler method for when a controlled toggle's value is changed.
 /// </summary>
 /// <param name="toggle">The toggle whose value was changed.</param>
 /// <param name="value">The value changed to.</param>
 protected virtual void Toggle_ValueChanged(TToggleController toggle, bool value)
 {
     ValueChanged?.Invoke(toggle, value);
 }
Exemplo n.º 11
0
        public Task UpdateInternalValue(string value)
        {
            Value = value;

            return(ValueChanged.InvokeAsync(Value));
        }
Exemplo n.º 12
0
        /// <summary>
        /// Update method
        /// </summary>
        protected void Update(object sender, EventArgs e)
        {
            // Update cursor
            _cursor = new Rectangle(_cursorPosition, new Size(Width, _cursorLength));

            // Update cursor position
            if (_cursorClick)
            {
                _cursorPosition = new Point(0, _cursorPositionPrevious.Y + _mouseIncrement);

                // Run events
                Scroll?.Invoke(this, new EventArgs());
                ValueChanged?.Invoke(this, new PropertyChangedEventArgs("ValueChanged"));
                _visible = true;
            }

            // Limit cursor position
            // Minimal
            if (_cursorPosition.Y < 0)
            {
                _cursorPosition.Y = 0;
            }

            // Maximal
            if (_cursorPosition.Y + _cursorLength > Height)
            {
                _cursorPosition.Y = Height - _cursorLength;
            }

            // Update value
            _value = GetValue();

            // Call mouse leave method
            try { if (!ClientRectangle.Contains(PointToClient(MousePosition)))
                  {
                      base.OnMouseLeave(e);
                  }
            } catch { }

            // Timer
            if (_visible && !_hover)
            {
                _timer++;
                if ((_timer % 200) == 0)
                {
                    _timer   = 0;
                    _visible = false;
                }
            }

            // Update alpha
            if (AutoHide)
            {
                if (_visible)
                {
                    if (_alpha < 255)
                    {
                        _alpha += 15;
                    }
                    if (Width < (_scrollbarMinified ? 4 : 20))
                    {
                        Width++;
                    }
                }
                else
                {
                    if (_alpha > 0)
                    {
                        _alpha -= 15;
                    }
                    if (Width > 5)
                    {
                        Width--;
                    }
                }
            }

            // Redraw scrollbar
            Invalidate();
        }
 //-------------------------------------------------------
 // Invoke the ValueChanged event; called  when value
 // is changed
 //-------------------------------------------------------
 protected virtual void OnValueChanged(object sender, KnobValueChangedEventArgs e) => ValueChanged?.Invoke(sender, e);
Exemplo n.º 14
0
 public void OnValueChanged(object sender, EventArgs e)
 {
     ValueChanged?.Invoke(this, e);
 }
 private void RaiseDataContextChanged(object sender, EventType args)
 {
     ValueChanged?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 16
0
 private void OnValueChangedLocal(object sender, EventArgs e) => ValueChanged?.Invoke(this, e);
Exemplo n.º 17
0
 /// <summary>
 /// To call the event <see cref="ValueChanged"/>.
 /// </summary>
 private void RaiseValueChanged()
 {
     ValueChanged?.Invoke();
     this.Notify(nameof(Value));
 }
Exemplo n.º 18
0
 protected virtual void OnValueChanged()
 {
     ValueChanged?.Invoke();
 }
Exemplo n.º 19
0
 private void NativeTextBox_PasswordChanged(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     ValueChanged?.Invoke(this, ((IInputControl <string>) this).Value);
 }
Exemplo n.º 20
0
 public static Widget SettingSlider(string title, float value, float min = 0f, float max = 1f, int divisions = 10, ValueChanged <float> valueChanged = null)
 {
     return(new Container(
                padding: EdgeInsets.symmetric(horizontal: 6f),
                child: new Row(
                    children: new List <Widget>
     {
         new Container(child: new Text(title)),
         new Expanded(
             child: new Container(
                 //color: Colors.red,
                 alignment: Alignment.bottomRight,
                 child:  new Slider(
                     label: $"{value:N1}",
                     min: min,
                     max: max,
                     value: value,
                     activeColor: Colors.black,
                     inactiveColor: Colors.grey,
                     divisions: divisions,
                     onChanged: valueChanged
                     ) //slider
                 )     //container
             ),        //expanded
         new ConstrainedBox(
             constraints: new BoxConstraints(
                 minWidth: 30
                 ),
             child: new Container(
                 alignment: Alignment.centerRight,
                 child: new Text($"{value:N1}")
                 )
             )        //ConstrainedBox
     }                //list
                    ) //row
                ));
 }
Exemplo n.º 21
0
 /// <summary>
 /// Ons the value changed.
 /// <para xml:lang="es">Cambia el valor</para>
 /// </summary>
 /// <returns>The value changed.
 /// <para xml:lang="es">El valor cambiado.</para>
 /// </returns>
 private void OnValueChanged()
 {
     ValueChanged?.Invoke(this, ((IInputControl <string>) this).Value);
 }
Exemplo n.º 22
0
 public static Widget SettingDropDown(string title, List <string> itemList, int selectedIndex = 0, ValueChanged <int> onValueChanged = null)
 {
     return(new Container(
                padding: EdgeInsets.symmetric(horizontal: 6f),
                child: new Row(
                    children: new List <Widget>
     {
         new Container(child: new Text(title)),
         new Expanded(
             child: new Container(
                 //color: Colors.red,
                 alignment: Alignment.bottomRight,
                 child:  new DropdownButton <string>(
                     style: new TextStyle(fontSize: 14),
                     value: itemList[selectedIndex],
                     onChanged: (string newValue) => {
             int index = itemList.FindLastIndex(s => s.Equals(newValue));
             //Debug.Log($"onChanged:{newValue} at {index}");
             onValueChanged?.Invoke(index);
         },
                     items: itemList.Select <string, DropdownMenuItem <string> >(value => {
             return new DropdownMenuItem <string>(
                 value: value,
                 child: new Text(value)
                 );
         }).ToList()
                     ) //dropdown
                 )     //container
             )         //expanded
     }                 //list
                    )  //row
                ));
 }
Exemplo n.º 23
0
 public CustomSegmentedControl(
     List <object> items,
     List <Widget> children,
     ValueChanged <int> onValueChanged = null,
     int currentIndex               = 0,
     float headerHeight             = 44,
     Widget trailing                = null,
     Decoration headerDecoration    = null,
     Decoration indicator           = null,
     EdgeInsets headerPadding       = null,
     EdgeInsets labelPadding        = null,
     float?indicatorWidth           = null,
     Color unselectedColor          = null,
     Color selectedColor            = null,
     TextStyle unselectedTextStyle  = null,
     TextStyle selectedTextStyle    = null,
     CustomTabController controller = null,
     ScrollPhysics physics          = null,
     ValueChanged <int> onTap       = null,
     Key key = null
     ) : base(key: key)
 {
     D.assert(items != null);
     D.assert(items.Count >= 2);
     D.assert(children != null);
     D.assert(children.Count >= 2);
     D.assert(children.Count == items.Count);
     D.assert(currentIndex < children.Count);
     this.items            = items;
     this.children         = children;
     this.onValueChanged   = onValueChanged;
     this.unselectedColor  = unselectedColor ?? CColors.TextBody4;
     this.selectedColor    = selectedColor ?? CColors.TextTitle;
     this.currentIndex     = currentIndex;
     this.headerHeight     = headerHeight;
     this.trailing         = trailing;
     this.headerDecoration = headerDecoration ?? new BoxDecoration(
         color: CColors.White,
         border: new Border(bottom: new BorderSide(color: CColors.Separator2))
         );
     this.indicator = indicator ?? new CustomGradientsTabIndicator(
         insets: EdgeInsets.zero,
         height: 8,
         gradient: new LinearGradient(
             begin: Alignment.centerLeft,
             end: Alignment.centerRight,
             new List <Color> {
         new Color(0xFFB1E0FF),
         new Color(0xFF6EC6FF)
     }
             )
         );
     this.headerPadding       = headerPadding ?? EdgeInsets.only(bottom: 10);
     this.labelPadding        = labelPadding ?? EdgeInsets.symmetric(horizontal: 16);
     this.indicatorWidth      = indicatorWidth;
     this.unselectedTextStyle = unselectedTextStyle ?? new TextStyle(
         fontSize: 16,
         fontFamily: "Roboto-Regular",
         color: this.unselectedColor
         );
     this.selectedTextStyle = selectedTextStyle ?? new TextStyle(
         fontSize: 16,
         fontFamily: "Roboto-Medium",
         color: this.unselectedColor
         );
     this.controller = controller;
     this.physics    = physics;
     this.onTap      = onTap;
 }
Exemplo n.º 24
0
        public static Widget SettingHSVColorPicker(
            BuildContext context,
            string title,
            ValueChanged <Color> onColorChanged,
            Color color            = null,
            string buttonName      = "",
            bool enableAlpha       = false,
            bool showPreviousColor = false
            )
        {
            if (color == null)
            {
                color = Colors.blueAccent;
            }
            if (buttonName == "")
            {
                buttonName = color.ToHexString(enableAlpha);
            }

            return(new Container(
                       padding: EdgeInsets.symmetric(horizontal: 6f),
                       child: new Row(
                           children: new List <Widget>
            {
                new Container(child: new Text(title)),
                new Expanded(
                    child: new Container(
                        padding: EdgeInsets.all(6),
                        alignment: Alignment.bottomRight,
                        child:  new RaisedButton(
                            color: color,
                            child: new Text(
                                buttonName,
                                style: new TextStyle(
                                    color: Utils.useWhiteForeground(color) ? Colors.white : Colors.black
                                    ) //TextStyle
                                ),    //Text
                            onPressed: () => {
                    DialogUtils.showDialog(
                        context: context,
                        builder: (BuildContext _) => {
                        if (showPreviousColor)
                        {
                            return new AlertDialog(
                                titlePadding: EdgeInsets.all(0),
                                contentPadding: EdgeInsets.all(0f),
                                shape: new RoundedRectangleBorder(
                                    borderRadius: BorderRadius.circular(25)
                                    ),                    //RoundedRectangleBorder
                                content: new SingleChildScrollView(
                                    child: new SlidePicker(
                                        pickerColor: color,
                                        onColorChanged: onColorChanged,
                                        paletteType: PaletteType.hsv,
                                        enableAlpha: enableAlpha,
                                        displayThumbColor: true,
                                        showLabel: false,
                                        showIndicator: true,
                                        indicatorBorderRadius: BorderRadius.vertical(top: Radius.circular(25))
                                        )             //SlidePicker
                                    )                 //SingleChildScrollView
                                );                    //AlertDialog
                        }
                        else
                        {
                            return new AlertDialog(
                                titlePadding: EdgeInsets.all(0f),
                                contentPadding: EdgeInsets.all(0f),
                                content: new SingleChildScrollView(
                                    child: new ColorPicker(
                                        pickerColor: color,
                                        onColorChanged: onColorChanged,
                                        colorPickerWidth: 300f,
                                        pickerAreaHeightPercent: 0.7f,
                                        enableAlpha: enableAlpha,
                                        displayThumbColor: true,
                                        showLabel: true,
                                        paletteType: PaletteType.hsv,
                                        pickerAreaBorderRadius: BorderRadius.only(
                                            topLeft: Radius.circular(2f),
                                            topRight: Radius.circular(2f)
                                            )         //BorderRadius
                                        )             //ColorPicker
                                    )                 //SingleChildScrollView
                                );                    //AlertDialog
                        }
                    }
                        );
                }
                            )
                        )    //container
                    ),       //expanded
            }                //list
                           ) //row
                       ));
        }
Exemplo n.º 25
0
 public virtual void OnValueChanged(ValueUpdateEventArgs e) => ValueChanged?.Invoke(this, e);
Exemplo n.º 26
0
        public static Widget SettingBlockColorPicker(
            BuildContext context,
            string title,
            ValueChanged <Color> onColorChanged,
            Color color                  = null,
            string buttonName            = "",
            List <Color> availableColors = null
            )
        {
            if (color == null)
            {
                color = Colors.blueAccent;
            }
            if (buttonName == "")
            {
                buttonName = color.ToHexString(false);
            }
            if (availableColors == null)
            {
                availableColors = Utils._defaultColors;
            }

            return(new Container(
                       padding: EdgeInsets.symmetric(horizontal: 6f),
                       child: new Row(
                           children: new List <Widget>
            {
                new Container(child: new Text(title)),
                new Expanded(
                    child: new Container(
                        padding: EdgeInsets.all(6),
                        alignment: Alignment.bottomRight,
                        child:  new RaisedButton(
                            color: color,
                            child: new Text(
                                buttonName,
                                style: new TextStyle(
                                    color: Utils.useWhiteForeground(color) ? Colors.white : Colors.black
                                    ) //TextStyle
                                ),    //Text
                            onPressed: () => {
                    DialogUtils.showDialog(
                        context: context,
                        builder: (BuildContext _) => {
                        return new AlertDialog(
                            title: new Text("Select color"),
                            content: new SingleChildScrollView(
                                child: new BlockPicker(
                                    pickerColor: color,
                                    onColorChanged: onColorChanged,
                                    availableColors: availableColors
                                    )     //BlockPicker
                                )         //SingleChildScrollView
                            );            //AlertDialog
                    }
                        );                //showDialog
                }
                            )
                        )    //container
                    ),       //expanded
            }                //list
                           ) //row
                       ));
        }
Exemplo n.º 27
0
 public void TriggerValueChanged()
 {
     ComboBox.UpdateLabel(SelectedItem?.DisplayText);
     Close();
     ValueChanged?.Invoke(this, null);
 }
Exemplo n.º 28
0
 public GetPropertyOfModel(Property <T> property)
 {
     this.property          = property;
     property.ValueChanged += (s, e) => ValueChanged?.Invoke(this, e);
     property.ValueChanged += (s, e) => SpecialForMishaValueChanged?.Invoke(this, new EventArgs());
 }
Exemplo n.º 29
0
 protected virtual void OnValueChanged(EventArgs e)
 {
     ValueChanged?.Invoke(this, e);
 }
Exemplo n.º 30
0
 private void OnValueChanged()
 {
     ValueChanged?.Invoke(this);
 }
Exemplo n.º 31
0
 public PropertySerializer(string name, string cate, string desc, object value, ValueChanged handler)
 {
     Name = name;
     Category = cate;
     Desc = desc;
     mValue = value;
     Handle = handler;
 }
Exemplo n.º 32
0
        public _RenderRangeSlider(
            RangeValues values,
            int?divisions,
            RangeLabels labels,
            SliderThemeData sliderTheme,
            ThemeData theme,
            float textScaleFactor,
            RuntimePlatform platform,
            ValueChanged <RangeValues> onChanged,
            ValueChanged <RangeValues> onChangeStart,
            ValueChanged <RangeValues> onChangeEnd,
            _RangeSliderState state,
            TextDirection?textDirection)
        {
            D.assert(values != null);
            D.assert(values.start >= 0.0 && values.start <= 1.0);
            D.assert(values.end >= 0.0 && values.end <= 1.0);
            D.assert(state != null);
            D.assert(textDirection != null);

            this.onChangeStart = onChangeStart;
            this.onChangeEnd   = onChangeEnd;

            _platform        = platform;
            _labels          = labels;
            _values          = values;
            _divisions       = divisions;
            _sliderTheme     = sliderTheme;
            _theme           = theme;
            _textScaleFactor = textScaleFactor;
            _onChanged       = onChanged;
            _state           = state;
            _textDirection   = textDirection;

            _updateLabelPainters();

            GestureArenaTeam team = new GestureArenaTeam();

            _drag          = new HorizontalDragGestureRecognizer();
            _drag.team     = team;
            _drag.onStart  = _handleDragStart;
            _drag.onUpdate = _handleDragUpdate;
            _drag.onEnd    = _handleDragEnd;
            _drag.onCancel = _handleDragCancel;

            _tap             = new TapGestureRecognizer();
            _tap.team        = team;
            _tap.onTapDown   = _handleTapDown;
            _tap.onTapUp     = _handleTapUp;
            _tap.onTapCancel = _handleTapCancel;

            _overlayAnimation = new CurvedAnimation(
                parent: _state.overlayController,
                curve: Curves.fastOutSlowIn
                );
            _valueIndicatorAnimation = new CurvedAnimation(
                parent: _state.valueIndicatorController,
                curve: Curves.fastOutSlowIn
                );
            _enableAnimation = new CurvedAnimation(
                parent: _state.enableController,
                curve: Curves.easeInOut
                );
        }