How can I use Relative binding to pass down IsEnabled to a child of a template?

public LinkTemplate()
{
    this.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
    Label LL = new Label();
    LL.BindingContext = this;
    LL.SetBinding(Label.IsEnabledProperty, Label.IsEnabledProperty.PropertyName);

    this.Children.Add(LL, 0, 0);
}

Set the BindingContext property of Label and SetBinding of IsEnabled Property. So, When you will change the IsEnbaled property of LinkTemplate then Label IsEnabled property will also change.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top