
I need to do track when the state of toolwindow changes. And need to add code if it is in floating state or docking state. This code is related to sizing issue. The content should resize according to the space available when tool window is floating and when user changes the size of toolwindow.
So first step, I created custom class from ToolWindow named ActiveProToolWin.
public ActiveProToolWin(DockSite docksite, string name, string title, ImageSource image_source, object content) :
base(docksite, name, title, image_source, content)
{
StateProperty.OverrideMetadata(typeof(ActiveProToolWin), new FrameworkPropertyMetadata(new PropertyChangedCallback(StatePropertyChanged)));
// OnPropertyChanged("StateProperty");
}
But it is showing error
" 'State' property was registered as read-only and its metadata cannot be overridden without an authorization key."
I tried another piece of code in my custom class.
protected override void OnStateChanged(DockingWindowState oldValue, DockingWindowState newValue)
{
base.OnStateChanged(oldValue, newValue);
ToolWindowState = newValue;
}
Now it is tracking the state change but how i am gonna code what i want.
I am missing something here.
Does any one get same problem?
Thanks,
N