I have a ContextMenu with MenuItems in it with their CheckOnClick property set to true.
And I want to save the Checked state of each MenuItem in the user.config file.
So what I did is bind the Checked property of the MenuItem to an application settings I created.
But when I click the MenuItem, it gets checked but the application setting value doesn't change.
A quote from an MSDN article comes to mind:
"You can only bind an application setting to a component that supports the IBindableComponent interface. Also, the component must implement a change event for a specific bound property, or notify application settings that the property has changed through the INotifyPropertyChanged interface. If the component does not implement IBindableComponent and you are binding through Visual Studio, the bound properties will be set the first time, but will not update. If the component implements IBindableComponent but does not support property change notifications, the binding will not update in the settings file when the property is changed."
Is it related to my issue?
How can I check if a control supports IBindableComponent ?
When I searched MenuItem in MSDN I got this under MenuItem Class (System.Windows.Controls) :
public class MenuItem : HeaderedItemsControl, ICommandSource
If IBindableComponent is not there does it mean that the control doesn't implement it?
And if indeed the aforementioned property cannot be bound to an application setting, what other alternatives do I have to achieve what I'm trying to do?
Thanks in advnance,