-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Only show back button when changing from collapsed details view #941
Only show back button when changing from collapsed details view #941
Conversation
} | ||
else | ||
else if (previousState == MasterDetailsViewState.Details) | ||
{ | ||
// Make sure we show the back button if the stack can navigate back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment does not accurately describe the code block anymore. Could be updated or removed.
Personally I think some explanation can be helpful here; the same explanation you gave in your PR comment can be very insightful.
SetBackButtonVisibility(_stateGroup.CurrentState); | ||
|
||
UpdateViewState(); | ||
UpdateView(true); | ||
} | ||
|
||
private void OnUnloaded(object sender, RoutedEventArgs e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the OnUnloaded method be extended with a method setting the BackButton to its previous state? Right now, when opening the details view and then navigating to another page, the back button remains visible (also in apps where the back button by default is not visible). If the user navigates back and the viewState is still Details, at that point it can be made visible again.
Up:) |
Not sure how I feel about changing on Unload. Other thoughts? |
AFAIC, I don't think it is a problem. |
@deltakosh Don't think it's an issue to remove the backbutton? What happens then when navigating forward? Example:
|
We can provide a Boolean to control this behavior. What are the other options? |
What would the proposed property be? |
Ok gotcha..This is tougher than what I was expecting |
I'm good with a property, but what should it be called? It's a very specific property. What should it do? Should it reset, should it do nothing, should it check if there are items in the Frame stack? |
Hehe! I'm not really good at naming (at least in English) but I would find ControlBackbuttonVisibilityWhenUnloaded clear enough. |
Moving to 1.5 (ping me if you think you can still make it for 1.4) |
as @deltakosh would say, Up :) |
Propose this be merged and a new issue be opened to address any additional issues |
Opened #1176 to discuss. Merging this. |
Changes to when the MasterDetailsView updates the back button visibility. It will now only update the visibility if in the ViewState is MasterDetailsViewState.Details, or if it is changing from MasterDetailsViewState.Details.
The control also will keep track if the back button was visible before it changes it when going into the Details state. If the MasterDetailsView is going from MasterDetailsViewState.Details, it will set the back button visibility to whatever is was previously.
Fixes ##939 and possibly #906. Tested #906 after fixing this and I cannot reproduce