The only way to do this is if you have a link to the associated BindingExpression .
Assuming you have a Thumb link in your code, it will look like this:
var bindingExpression = thumb.GetBindingExpression(Thumb.IsEnabledProperty); if (bindingExpression != null) bindingExpression.UpdateTarget();
It is best to use a singleton pattern, for example:
public class ViewTemplateManager : NotifyBase { public bool CanResizeColumns { get; set; } public static ViewTemplateManager Instance { get; private set; } static ViewTemplateManager() { Instance = new ViewTemplateManager(); } private ViewTemplateManager() { CanResizeColumns = true; } }
Then bind yourself like this:
<Thumb x:Name="PART_HeaderGripper" IsEnabled="{Binding Source={x:Static viewManager:ViewTemplateManager.Instance}, Path=CanResizeColumns}}"
Then you just need to raise the INotifyPropertyChanged.PropertyChanged event when CanResizeColumns changes.
source share