Check out example codes for "wpf binding ancestor codebehind". It will help you in understanding the concepts better.

Code Example 1

Binding b = new Binding();

      b.RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor,this.GetType(),1);

      b.Path = new PropertyPath("MyDP");

      MyLable.SetBinding(ContentProperty, b);

Learn ReactJs, React Native from akashmittal.com