public static BindingMarkup GetBindingExpressionOrNull(RedwoodProperty property, RedwoodBindable obj) { var value = obj.GetRawValue(property); if (value is BindingMarkup) { return (BindingMarkup)value; } return null; }
public static CommandMarkupExpression GetCommandExpressionOrNull(RedwoodProperty property, RedwoodBindable obj) { var value = obj.GetRawValue(property); if (value is CommandMarkupExpression) { return (CommandMarkupExpression)value; } return null; }
/// <summary> /// Gets the chain of data context property values. /// </summary> private static Stack<Tuple<RedwoodBindable, BindingMarkup>> GetDataContextBindingChain(RedwoodBindable control) { var parents = new Stack<Tuple<RedwoodBindable, BindingMarkup>>(); while (control != null) { var binding = (BindingMarkup)control.GetRawValue(RedwoodControl.DataContextProperty, true); if (binding != null) { parents.Push(new Tuple<RedwoodBindable, BindingMarkup>(control, binding)); } control = control.Parent; } return parents; }