public void Bind(object Object, string PropertyName)
        {
            UnBind();
            _value.Bind(Object, PropertyName);

            if (IsColor)
            {
                ColorSelect.BackColor = System.Drawing.Color.FromArgb((int)(W * 255), (int)(X * 255), (int)(Y * 255), (int)(Z * 255));
            }
            else
            {
                XEdit.Bind(this, "X");
                YEdit.Bind(this, "Y");
                ZEdit.Bind(this, "Z");
                WEdit.Bind(this, "W");
            }
        }
Example #2
0
        /// <summary>
        /// Binds an objects enum property to this combobox
        /// </summary>
        /// <param name="Object"></param>
        /// <param name="PropertyName"></param>
        public void Bind(object Object, string PropertyName)
        {
            _value.Bind(Object, PropertyName);

            if (_value.IsBound)
            {
                if (typeof(T).IsValueType)
                {
                    foreach (var e in (T[])Enum.GetValues(typeof(T)))
                    {
                        Items.Add(e);
                    }
                }

                SelectedItem = _value.Value;
            }
        }