Home
Manage Your Code
Snippet: Getting the binding element from the current DataContext (C#)
Title: Getting the binding element from the current DataContext Language: C#
Description: Getting the binding element from the current DataContext Views: 169
Author: Andy Britcliffe Date Added: 1/7/2008
Copy Code  
1private Binding GetBinding(string path)
2        {
3            Binding binding1 = new Binding();
4            binding1.Source = this.DataContext;
5            binding1.Mode = BindingMode.Default;
6            binding1.Path = new PropertyPath(path);
7            return binding1;
8        }