The Visibility of the LayoutDocumentPane is evaluated in its method "GetVisibility()".
This means you can use this method to return True or False weather you want to show or hide the LayoutDocumentPane.
You could maybe add a bool DependencyProperty in the new MyLayoutDocumentPane class which would be bound as you did. On the propertyChanged, force a VisibilityRefresh. Then, use GetVisibility() method like this :
This means you can use this method to return True or False weather you want to show or hide the LayoutDocumentPane.
You could maybe add a bool DependencyProperty in the new MyLayoutDocumentPane class which would be bound as you did. On the propertyChanged, force a VisibilityRefresh. Then, use GetVisibility() method like this :
protected override bool GetVisibility()
{
return this.MyBool;
}
The complete MyLayoutDocumentPane class : public class MyLayoutDocumentPane : Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane
{
#region MyBool
public static readonly DependencyProperty MyBoolProperty = DependencyProperty.Register( "MyBool", typeof( bool ), typeof( MyLayoutDocumentPane ),
new UIPropertyMetadata( true, OnMyBoolChanged ) );
public bool MyBool
{
get
{
return (bool)GetValue( MyLayoutDocumentPane.MyBoolProperty );
}
set
{
SetValue( MyLayoutDocumentPane.MyBoolProperty, value );
}
}
private static void OnMyBoolChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
{
((MyLayoutDocumentPane)d).OnMyBoolChanged( (bool)e.OldValue, (bool)e.NewValue );
}
protected virtual void OnMyBoolChanged( bool oldValue, bool newValue )
{
this.ComputeVisibility();
}
#endregion //MyBool
protected override bool GetVisibility()
{
return this.MyBool;
}
}