예제 #1
0
        public BindableInt Set(T lookup, int value, int?min = null, int?max = null)
        {
            BindableInt bindable = GetBindable <int>(lookup) as BindableInt;

            if (bindable == null)
            {
                bindable = new BindableInt(value);
                addBindable(lookup, bindable);
            }
            else
            {
                bindable.Value = value;
            }

            if (min.HasValue)
            {
                bindable.MinValue = min.Value;
            }
            if (max.HasValue)
            {
                bindable.MaxValue = max.Value;
            }

            return(bindable);
        }
예제 #2
0
        public BindableInt Set(T lookup, int value)
        {
            BindableInt bindable = GetBindable <int>(lookup) as BindableInt;

            if (bindable == null)
            {
                bindable = new BindableInt(value);
                addBindable(lookup, bindable);
            }
            else
            {
                bindable.Value = value;
            }

            return(bindable);
        }