示例#1
0
        public static BindingMarkup GetBindingExpressionOrNull(RedwoodProperty property, RedwoodBindable obj)
        {
            var value = obj.GetRawValue(property);
            if (value is BindingMarkup)
            {
                return (BindingMarkup)value;
            }

            return null;
        }
示例#2
0
        public static CommandMarkupExpression GetCommandExpressionOrNull(RedwoodProperty property, RedwoodBindable obj)
        {
            var value = obj.GetRawValue(property);
            if (value is CommandMarkupExpression)
            {
                return (CommandMarkupExpression)value;
            }

            return null;
        }
示例#3
0
 /// <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;
 }