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

ContextualTabs visibility problem #660

Closed
bochelie1000 opened this issue Oct 25, 2018 · 8 comments
Closed

ContextualTabs visibility problem #660

bochelie1000 opened this issue Oct 25, 2018 · 8 comments
Assignees
Labels
Milestone

Comments

@bochelie1000
Copy link

bochelie1000 commented Oct 25, 2018

Environment

  • Fluent.Ribbon v7.0.0-alpha0456 and before
  • Windows 7
  • .NET Framework 4.6.1 and lower

There is an issue that ContextualTabs or Tabs will not be drawn correctly or even be shown if the visibility is set in begin code on startup.

I attached a repro. To reproduce:

-Start the application.
-Click on Buttons 1 and 2 on the home tab.
-This will change the next tabs.
-This works fine. You will see the Tab with header 11111 and the tab with header 22222 depending which button you click.

-Now stop the application.
-Go to the behind code and activate the 3 lines after the InitializeComponent method.

-Restart the application.

-Click button 1 and 2 on the Home tab.
-See how the next tab is not working correctly.

Once again I realy appreciate all the effort you put into this great Ribbon.

Regards

CTabsTest 2.zip

@batzen batzen added this to the 7.0.0 milestone Nov 17, 2018
@batzen batzen self-assigned this Nov 17, 2018
@batzen
Copy link
Member

batzen commented Nov 17, 2018

Well, i am not sure i really should consider this a bug in the ribbon.
The problem with your code is that it sets a local value for Visibility and there are style triggers which try to modify the value, but as it's a local value the triggers can't modify the value as it's impossible to overwrite local set properties from style triggers.

What's your use case for this? What are you trying to achieve?
One way to solve your issue would be to use an inherited style and set the values from style setters instead of using a local value.

@batzen batzen removed this from the 7.0.0 milestone Nov 17, 2018
@batzen batzen removed the Bug 🐞 label Nov 17, 2018
@bochelie1000
Copy link
Author

bochelie1000 commented Nov 17, 2018

Well I was just trying to change the visibility of the tabs when the user clicks on a button in the ribbon. I needed some tabs to be hidden on startup. My solution was to not change the visibility in the Initialize method. I changed the way my app works so that there is no need to hide those tabs on startup.

After the app is loaded I can change the visibility in behind code without any problem as you can see in the button_click method. That is why I thought it was a bug.

@batzen
Copy link
Member

batzen commented Nov 17, 2018

In your app the button click only modifies the groups visibility.
You can control/trigger visibility in two ways:

  • hiding the group hides all tabs contained in the group
  • hiding all tabs of a group hides the group

If visibility is set manually on a tab or group that value can't be overwritten be the style triggers.

@bochelie1000
Copy link
Author

Ok, good to know.

@batzen
Copy link
Member

batzen commented Nov 18, 2018

Do have any further questions or can we close this issue?

@bochelie1000
Copy link
Author

No. It can be closed. Thanks.

@batzen batzen closed this as completed Nov 18, 2018
@batzen batzen added the Bug 🐞 label Dec 3, 2018
@batzen batzen added this to the 7.0.0 milestone Dec 3, 2018
@batzen
Copy link
Member

batzen commented Dec 3, 2018

As this issue was reported again with #673 i had another look and found a solution.

@bochelie1000
Copy link
Author

Great! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants