Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #98 with floating window without a content #99

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ internal LayoutAnchorableFloatingWindowControl(LayoutAnchorableFloatingWindow mo
{
root.Updated += OnRootUpdated;
}

_model.IsVisibleChanged += _model_IsVisibleChanged;
}

private void OnRootUpdated(object sender, EventArgs e)
Expand Down Expand Up @@ -194,6 +196,7 @@ protected override void OnClosed(EventArgs e)
BindingOperations.ClearBinding(_model, VisibilityProperty);

_model.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(_model_PropertyChanged);
_model.IsVisibleChanged -= _model_IsVisibleChanged;
Activated -= LayoutAnchorableFloatingWindowControl_Activated;
IsVisibleChanged -= this.LayoutAnchorableFloatingWindowControl_IsVisibleChanged;
BindingOperations.ClearBinding(this, VisibilityProperty);
Expand Down Expand Up @@ -285,6 +288,14 @@ private void _model_PropertyChanged(object sender, System.ComponentModel.Propert
}
}

private void _model_IsVisibleChanged(object sender, EventArgs e)
{
if (!this.IsVisible && _model.IsVisible)
{
this.Show();
}
}

private void CreateOverlayWindow()
{
if (_overlayWindow == null)
Expand Down
23 changes: 20 additions & 3 deletions source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,17 @@ protected virtual void OnLayoutChanged(LayoutRoot oldLayout, LayoutRoot newLayou
fw.WindowState = WindowState.Maximized;
}
else
fw.Show();
{
if (fw.Content != null || (fw.Model as LayoutAnchorableFloatingWindow)?.IsVisible == true)
{
fw.Show();
}
else
{
fw.Hide();
}
}

//fw.Owner = Window.GetWindow(this);
//fw.SetParentToMainWindowOf(this);
}
Expand Down Expand Up @@ -2100,8 +2110,15 @@ internal UIElement CreateUIElementForModel(ILayoutElement model)

Dispatcher.BeginInvoke(new Action(() =>
{
newFW.Show();
}), DispatcherPriority.Send);
if (newFW.Content != null || (newFW.Model as LayoutAnchorableFloatingWindow)?.IsVisible == true)
{
newFW.Show();
}
else
{
newFW.Hide();
}
}), DispatcherPriority.Send);

if (panegroup != null && panegroup.IsMaximized)
{
Expand Down