"Float All" command misbehaves when at least one document has "CanFloat = false"

Docking/MDI for Avalonia Forum

Posted 4 days ago by kucint.bp
Version: 25.2.3
Platform: .NET 9
Environment: Windows 11 (64-bit)
Avatar

Hi,

Docking UI provides a Menu item "Float All" which works fine when all docked items support floating i.e. they have CanFloat = true.
If this is not the case, the command misbehaves in some scenarios.
It may happen that some docking documents become invisible (but stil exsit)

My understanding of what is happening is the following:

  • "Float All" command in called
  • All docking documents are first somehow detached from current host.
  • A new window witha new host is created.
  • All docking documents are attached to the new host.

if detaching of docking documents fails due to one document having CanFloat = false, the hole operation fails and some docking documents are no longer accessible.

What I expect:

  • "Float all" shall float all doucuments that have  CanFloat = true. All other documents stay where they are.

Best!
tomasz

Comments (4)

Posted 4 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thanks for reaching out.  I tried testing this scenario in our Docking/MDI's Simple IDE demo, but was unable to reproduce it.  In my test, I took these steps:

1) Set one of the document windows to have CanFloat = false.

2) Ran the demo, right clicked on a document tab, and picked the Float All menu item.

3) All documents floated except the one that had CanFloat = false set, as expected.

In my testing, no documents became inaccessible.

Since your original post mentioned you’re on v25.2.3, could you let us know the exact steps needed to reproduce the problem in the Simple IDE demo for that version? That will help us pinpoint what might be different in your scenario.


Actipro Software Support

Posted 4 days ago by kucint.bp
Avatar

indeed. your scenario works by me as well.
Try this one:

  • create docA (CanFloat= false)
  • create doc1 (CanFloat= true)
  • create doc2 (CanFloat= true)
  • create doc3 (CanFloat= true)
  • note that the documents are presented in reverted order: doc3, doc2, doc1, docA
  • call FloatAll -> all doc1-3 are now undocked together in a separate cantainer. fine!
  • dock the container back to main window by drag&drop it
  • call FloatAll again -> all doc1-3 disapear.

let me know if you can pin it.
best.

Now I noticed, that the menu command Float leads to the same buggy behaviour.

Another scenario:

  • undock a doc1 document by drag & drop it out of the container
  • dock it back by drag & droping it
  • call Float of FloatAll -> Bug (doc1 disapears)

Sorry, I could not find where I can set CanFloat= false in your 'Docking/MDI', so test above refer to my App.

[Modified 3 days ago]

Posted 3 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Unfortunately, we're still not able to reproduce.  The currently released Sample Browser does not include an option to toggle if a document can float, but it is easy to add (and will be included in the next release).  There is a "Document Properties" tool window used by the Simple IDE sample which shows some basic properties for the selected document, and you can add a checkbox that binds to the document's CanFloat property.

Update the DocumentPropertiesToolWindow.axaml file and add the following after the "Is read-only" checkbox:

<CheckBox IsChecked="{Binding CanFloat}" Content="Can float" />

With that option, the "null" state means the global "Can Float" options are used (which is the default), so you can clear the checkbox to indicate that the selected document cannot float.

With that change, please try to reproduce in our sample app and provide steps to reproduce.  If you cannot reproduce in our sample app, please create a simple sample application that demonstrates the issue and send to our support email address with a reference to this forum post.  Before zipping your source, be sure to remove any bin/obj folders so the attachment is not blocked.

As a side note, double-check that the floating document windows have really disappeared and aren't just hiding behind the main application window.


Actipro Software Support

Posted 6 hours ago by kucint.bp
Avatar

I see..... 
this of course questions whether the issue is on your dide or on mine. :(
I will investigate it. Thanks for help.

Add Comment

Please log in to a validated account to post comments.