// ----------------------------------------------------------------------- // // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Perspex.Controls; /// /// Provides binding utility extension methods. /// public static class BindingExtensions { /// /// Binds a property in a template to the same property in the templated parent. /// /// The property type. /// The control in the template. /// The templated parent. /// The property. /// /// A disposable which can be used to terminate the binding. /// public static IDisposable TemplateBinding( this PerspexObject o, ITemplatedControl templatedParent, PerspexProperty property) { return o.Bind(property, templatedParent.GetObservable(property), BindingPriority.TemplatedParent); } } }