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

[Bug]: Unable to make closed auto hidden docked page visible after config reloading #822

Closed
dyurshevich opened this issue Oct 26, 2022 · 5 comments
Labels
area:docking All issues to do with the docking. area:navigator All issues to do with the navigator. bug Something isn't working fixed This issue has been fixed. version:90 All things to do with V90.
Milestone

Comments

@dyurshevich
Copy link

Describe the bug
Hi everyone.

I'm having an issue with making auto hidden docked page visible after loading dock config file. Visible property of the page becomes true, but page is still not shown. Worth to mention that config was saved with that page closed.

To Reproduce
The bug can be reproduced in demo app called Docking Persistence 2022.

  1. Create additional button that shows the page that we are experimenting on. Use KryptonDockingManager.ShowPage in the click handler.
  2. Make bottom panel auto hidden
  3. Close the page we used in step 1
  4. Save dock config file and reload back
  5. Press button from step 1 to show page
  6. Page stays hidden
  7. (Important) If we press "Show all pages" button right after config loading the page will appear

Expected behavior
Page should appear

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 10.0.19045

Additional context
I did some research on that issue.
If we take a look at the call stack inside KryptonDockingManager.ShowAllPages(), we end up in KryptonNavigator.UpdateAllPagesVisible which in its turn loops through pages changing Visible property and calling ViewBuilder.PageVisibleStateChanged for every page.
In contrast, when we call KryptonDockingManager. ShowPage, page Visible property changes in KryptonDockingAutoHiddenGroup.PropogateAction and no ViewBuilder.PageVisibleStateChanged is called. Explicitly calling it fixes the issue.

@dyurshevich dyurshevich added the bug Something isn't working label Oct 26, 2022
@Smurf-IV
Copy link
Member

Smurf-IV commented Jul 7, 2024

@dyurshevich Sorry for the delay, this seems to have slipped through the "cracks"
Do you have a demo, or is it "now" fixed with the latest alpha/canary, as some work has gone on in the Navigator(s) dll.

@Smurf-IV Smurf-IV added awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. area:docking All issues to do with the docking. area:navigator All issues to do with the navigator. labels Jul 7, 2024
@dyurshevich
Copy link
Author

No problem. Looks like the issue still exists. I've made some research myself and I believe the problem lies in KryptonAutoHiddenProxyPage.

Can be tested much easier than I described initially with the following steps:

  • Serialize KryptonDockingAutoHiddenGroup with two pages - one visible and another one not visible
<DEAH N="AutoHidden" C="1">
          <DAHG N="20c103ecd16b499ba8c5fa94f3aecfa1" C="2">
            <KP UN="Input 2" V="False" S="False">
              <CPD>
                <CustomPageData SavedMilliseconds="590" />
              </CPD>
            </KP>
            <KP UN="Input 3" V="True" S="False">
              <CPD>
                <CustomPageData SavedMilliseconds="590" />
              </CPD>
            </KP>
          </DAHG>
        </DEAH>
  • Then deserialize back. If we take a look deep inside kryptonDockingManager hierarchy, "Input 2" page has Visibility property set to True (mistakenly I suppose) but only one tab is visible.
  • If we try to make "Input 2" visible our command will be ignored since Visibility property already has a value of True.

So, in short, looks like KryptonAutoHiddenProxyPage does not inherit Visibility property from its page when being deserialized from xml.

The following code did the trick for me

        public KryptonAutoHiddenProxyPage(KryptonPage page)
        {
            // We are a proxy for this cached page reference
            Page = page ?? throw new ArgumentNullException(nameof(page));

            // Text property was updated by the base class constructor, so now we update the actual referenced class
            Page.Text = Text;
+
+            Visible = Page.Visible;
        }

@Smurf-IV
Copy link
Member

The following code did the trick for me

thanks for the research and solution find.

@Smurf-IV Smurf-IV added version:90 All things to do with V90. and removed awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. labels Jul 15, 2024
@Smurf-IV Smurf-IV added this to the Version 90 milestone Jul 15, 2024
@PWagner1 PWagner1 self-assigned this Jul 19, 2024
PWagner1 added a commit that referenced this issue Jul 19, 2024
@PWagner1
Copy link
Contributor

Hi @dyurshevich

Please retry using nightly >= .201

Smurf-IV added a commit that referenced this issue Jul 20, 2024
…osed-auto-hidden-docked-page-visible-after-config-reloading

* Resolves #822
@PWagner1 PWagner1 removed their assignment Jul 20, 2024
@PWagner1 PWagner1 added the fixed This issue has been fixed. label Jul 20, 2024
@dyurshevich
Copy link
Author

Hi @dyurshevich

Please retry using nightly >= .201

Works fine, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:docking All issues to do with the docking. area:navigator All issues to do with the navigator. bug Something isn't working fixed This issue has been fixed. version:90 All things to do with V90.
Projects
None yet
Development

No branches or pull requests

3 participants