Пример #1
0
        private void OnNumericItemValueChanged(object sender, int value)
        {
            SensePanelNumericItem _Item = (sender as SensePanelNumericItem);

            if (null != _Item)
            {
                switch (_Item.Name)
                {
                case "AlertDistance":
                    Settings.SetProperty(_Item.Name, value.ToString());
                    break;

                default:
                    break;
                }
            }
        }
Пример #2
0
        public static SensePanelNumericItem CreateNumericItem(SensePropertyBag parameter,
                                                              SensePanelNumericItem.ValueChangedEventHandler handler)
        {
            SensePanelNumericItem result = new SensePanelNumericItem(parameter.PropertyName)
            {
                AutoShowDialog     = true,
                AutoShowDialogText = parameter.PropertyLabel,
                ButtonAnimation    = false,
                PrimaryText        = parameter.PropertyLabel,
                SecondaryText      = parameter.PropertyExplanation,
                Value = int.Parse(Settings.GetProperty(parameter.PropertyName))
            };

            result.OnValueChanged += handler;

            return(result);
        }