void _PropertyLostFocusMethod(object sender, EvaluationCtrlLostFocusEventArgs e)
 {
     if (null != PropertyLostFocus)
     {
         PropertyLostFocus(sender, e);
     }
 }
예제 #2
0
        void pgec_LostFocus(object sender, EvaluationCtrlLostFocusEventArgs e)
        {
            var iuc = sender as PropertyGridEvaluationCtrl;

            _ReadUIElement.SetPropertyValue(e.PropertyName, e.Value);
            _PropertyLostFocusMethod(this, e);
        }
예제 #3
0
        void pgec_ContentChange(object sender, EvaluationCtrlTextChangeEventArgs e)
        {
            var          iuc           = sender as PropertyGridEvaluationCtrl;
            XElement     xe            = iuc.EvaluationContent;
            string       pName         = xe.Name.ToString();
            PropertyInfo pi            = _ReadUIElement.GetType().GetProperty(pName);
            string       _PropertyName = iuc.PropertyName;

            if (null == pi || _PropertyName.IsNullOrEmpty())
            {
                pi = _ReadUIElement.GetType().GetProperty(_PropertyName);
                if (null == pi)
                {
                    return;
                }
            }
            var pt = pi.PropertyType;

            if (pt.IsEnum)
            {
                pi.SetValue(_ReadUIElement, Enum.Parse(pi.PropertyType, string.Format("{0}", xe.Value), true), null);
            }
            else
            {
                pi.SetValue(_ReadUIElement, Convert.ChangeType(xe.Value, pt, null), null);
            }
            var ecf = new EvaluationCtrlLostFocusEventArgs(sender, _PropertyName, xe.Value.ToString(), this.CurrentSelectedControlName);

            _PropertyLostFocusMethod(this, ecf);
        }
 void _LostFocusMethod(object sender, EvaluationCtrlLostFocusEventArgs e)
 {
     if (null == LostFocus)
     {
         return;
     }
     LostFocus(sender, e);
 }
 /// <summary>
 /// 属性推动焦点事件
 /// </summary>
 /// <param name="e"></param>
 internal void PropertyLostFoucs(EvaluationCtrlLostFocusEventArgs e)
 {
     if (null == CurrentPageWorkArea)
     {
         return;
     }
     CurrentPageWorkArea.PropertyLostFoucs(e);
 }
        private void txtControlName_LostFocus(object sender, RoutedEventArgs e)
        {
            var ce = new EvaluationCtrlLostFocusEventArgs();

            ce.ControlName  = _ReadAttributeCtrl.GetPropertyValue("Name").ToString();
            ce.Source       = sender;
            ce.PropertyName = "Name";
            ce.Value        = this.txtControlName.Text.Trim();
            _PropertyLostFocusMethod(this, ce);
        }
예제 #7
0
        /// <summary>
        /// 属性失去焦点事件
        /// </summary>
        /// <param name="e"></param>
        internal void PropertyLostFoucs(EvaluationCtrlLostFocusEventArgs e)
        {
            string controlName = e.ControlName;

            if (!_XamlTemplate.CanvasTemplate.Children.ContainsKey(controlName))
            {
                return;
            }
            this.IsUpdate = true;
            string controlXaml = _XamlTemplate.CanvasTemplate.Children[controlName];
            Dictionary <String, object> modify = new Dictionary <string, object>();

            modify.Add(e.PropertyName, e.Value);
            controlXaml = Wrapper.ModifyXamlAttribute(modify, controlXaml);
            if (_XamlTemplate.CanvasTemplate.Children.ContainsKey(controlName))
            {
                _XamlTemplate.CanvasTemplate.Children.Remove(controlName);
            }
            _XamlTemplate.CanvasTemplate.Children.Add(controlName, controlXaml);
            this.Xaml_Template = _XamlTemplate.ParseXml().ToString();
        }
 void pcc_PropertyLostFocus(object sender, EvaluationCtrlLostFocusEventArgs e)
 {
     pwag.PropertyLostFoucs(e);
 }
 void pgProperty_PropertyLostFocus(object sender, EvaluationCtrlLostFocusEventArgs e)
 {
     _PropertyLostFocusMethod(this, e);
 }