public static PathExpression Parse (DependencyObject source, string path)
		{
			var paths = path.Split ('.');
			
			PathExpression expression = new SelfExpression (source);
			
			foreach (var p in paths) {
				expression = new PropertyExpression (expression, p);
			}

			return expression;
		}
		public static void SetBinding (DependencyObject source, string path, IDependencyProperty target, IValueConverter converter = null)
		{
			var paths = path.Split ('.');

			BindingExpression expression = new PropertyExpression (source.GetProperty (paths [0]));

			foreach (var p in paths.Skip(1)) {
				expression = new PathExpression (expression, p);
			}

			new Binding (expression, new PropertyExpression (target), converter ?? new EmptyConverter ());
		}
Esempio n. 3
0
        public static void SetBinding(DependencyObject source, string path, IDependencyProperty target, IValueConverter converter = null)
        {
            var paths = path.Split('.');

            BindingExpression expression = new PropertyExpression(source.GetProperty(paths [0]));

            foreach (var p in paths.Skip(1))
            {
                expression = new PathExpression(expression, p);
            }

            new Binding(expression, new PropertyExpression(target), converter ?? new EmptyConverter());
        }