From the course: .NET MAUI: Beyond the Basics

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Ancestor bindings

Ancestor bindings

- [Instructor] There are several different ways to handle data binding. As you know, the default is for the bindings of a view to look at its binding source. However, there are several other ways a view can bind to properties. A view can bind to other properties on itself. A view can bind to another named view. As an extension to this a view can bind to another view's binding source. This is what was commonly used before ancestor bindings were available in Xamarin Forms. In this video, we are going to look at a particular way to override the default binding source on a view, that is, to look at a view's ancestors. How this works is to look up the view hierarchy to find a specified type. It will look to bind to another view or a view's binding source. Ancestor bindings are only useful to find objects that are above the visual tree of the source view. That is to say, an ancestor binding will find a collection view from a…

Contents