The application is developed with C# and WPF.
I have a data binding to a static property of a non static class.
When the application is started, the binding does well, but if i change the bool of the binding, the view is not been updated.
How can i update the binding of this static property ?
NotifyChanged-Events don’t affected.
The class:
public class ViewTemplateManager : NotifyBase
{
public static bool CanResizeColumns { get; set; }
static ViewTemplateManager()
{
CanResizeColumns = true;
}
The View:
<Thumb x:Name="PART_HeaderGripper" IsEnabled="{Binding Source={x:Static Member=viewManager:ViewTemplateManager.CanResizeColumns}}"
The only way to do this is if you have a reference to the associated BindingExpression.
Assuming you have a reference to the Thumb in your code, it would look like:
Your best bet would be to use a singleton pattern, like so:
Then bind like so:
Then you simply need to raise the INotifyPropertyChanged.PropertyChanged event when you change CanResizeColumns.