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

Sometimes PreviousContainer got missing for LayoutAnchorable after float window is closed. #100

Open
yyjdelete opened this issue Dec 6, 2019 · 5 comments

Comments

@yyjdelete
Copy link

  1. Run TestApp from this repo(a54b7d5);
  2. Drag and drop the right tabs(Tool Window 1+2) to the same float window;
  3. Right click and hide Tool Window 1;
  4. Drag and drop Tool Window 2 to the top of the MainWindow;
  5. Click Tools/Tool Window 1

Expected:

It should still possbile to show Tool Window 1, either in an new float window or the same position as Tool Window 2;

Actual:

Tool Window 1 can not be shown, and see PreviousContainerId is missing from the output Layout.config;

@LyonJack
Copy link
Contributor

LyonJack commented Jul 1, 2020

There is an error on my codes,I will resolve it today

@Dirkster99
Copy link
Owner

I am not sure about this fix - I am getting an exception after (Step 4) dropping Tool Window 2 back into the DocumentPane and (step 5) trying to show Tool Window 1

Untitled

This is the exception that I see after step 5 in the above workflow:
Untitled1

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=AvalonDock
  StackTrace:
   at AvalonDock.Layout.LayoutContent.set_IsActive(Boolean value) in ...\AvalonDock-master\source\Components\AvalonDock\Layout\LayoutContent.cs:line 182

@LyonJack
Copy link
Contributor

LyonJack commented Jul 3, 2020

There is an error on my codes,I will resolve it today

@Dirkster99
Copy link
Owner

I tried a similar fix myself yesterday but failed with the same result its failing now 😞

  • When you follow the above workflow, Tool Window 1 does not re-appear in Step 5 (which is the objective of this issue).
  • When I repeat step 5 twice as the last step of the workflow I get a different exception in the client code:
System.InvalidOperationException
  HResult=0x80131509
  Message=Sequence contains no matching element
  Source=System.Linq
  StackTrace:
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at TestApp.MainWindow.OnShowToolWindow1(Object sender, RoutedEventArgs e) in ...AvalonDock-master\source\TestApp\MainWindow.xaml.cs:line 199
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

Untitled

@Dirkster99
Copy link
Owner

Closed the issue by accident - reopen since the issue is not fixed

@Dirkster99 Dirkster99 reopened this Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants