System.Windows.FrameworkElement.GetBindingExpression C# (CSharp) Method

GetBindingExpression() public method

public GetBindingExpression ( DependencyProperty dp ) : System.Windows.Data.BindingExpression
dp DependencyProperty
return System.Windows.Data.BindingExpression
		public BindingExpression GetBindingExpression (DependencyProperty dp)
		{
			Expression expression;
			if (expressions.TryGetValue (dp, out expression))
				return expression as BindingExpression;

			return null;
		}

Usage Example

Example #1
0
        protected override bool CommitCellEdit(System.Windows.FrameworkElement editingElement)
        {
            DatePicker dp = editingElement as DatePicker;

            if (dp == null)
            {
                return(true);
            }

            dp.Text = "01/01/2001";

            //if (!isCellValueChanged) tb.Text = Convert.ToString(previouseCellValue);

            //if (MaxScale > 0 && FormatCellAfterCellEndEdit)
            //{
            //    if (Convert.ToString(tb.Text).Trim().Length == 0) tb.Text = "0";
            //    string decimalFormat = "0." + "".PadLeft(MaxScale, '0');
            //    tb.Text = Convert.ToDecimal(Convert.ToString(tb.Text)).ToString(decimalFormat);
            //}

            BindingExpression binding = editingElement.GetBindingExpression(DatePicker.TextProperty);

            if (binding != null)
            {
                binding.UpdateSource();
            }

            return(true); //base.CommitCellEdit(editingElement);
        }
All Usage Examples Of System.Windows.FrameworkElement::GetBindingExpression