-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: Unloading progressring when loaded #747
Conversation
@Xiaoy312 @jeromelaban @Youssef1313 @kazo0 would really appreciate some input here. The only way that I've found of unloading the progressring is to set the LoadingContentTemplate to an empty template. The current code (a bit hacky) grabs a local copy of the LoadingContentTemplate so that it can be re-set when the control goes back to the Loading state. Any suggestions on a nicer approach? |
I think you can remove the |
private DataTemplate? loadingContentTemplatePlaceholder; | ||
private DataTemplateSelector? loadingContentTemplateSelectorPlaceholder; |
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.
Should those be reset if the original values change?
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.
yes, and there's probably a bit more refactoring to do. At this stage I just wanted to gauge whether or not there's a better approach before finalising this
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.
Those are private fields, and are not "place holder" but only some "cache" or "backing field". There nothing to reset IMHO.
Will this break the visual states though? |
private DataTemplate? loadingContentTemplatePlaceholder; | ||
private DataTemplateSelector? loadingContentTemplateSelectorPlaceholder; |
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.
Those are private fields, and are not "place holder" but only some "cache" or "backing field". There nothing to reset IMHO.
LoadingContentTemplate = loadingContentTemplatePlaceholder!; | ||
LoadingContentTemplateSelector = loadingContentTemplateSelectorPlaceholder!; |
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.
If the user changed the LoadingContentTemplate
or the LoadingContentTemplateSelector
while the view is "Loaded" they are going to be overwritten.
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.
@nickrandolph lets start a thread here, so we can keep the discussion in the same place.
I think you can remove the #LoadingContentPresenter from its parent on "Loaded", and then re-add it if it goes back to "Loading". Its content might need to be remove as well, to avoid unnecessarily proc'ing the template resolution & materialization, since the content is still bound to a possibly changing source LoadingContent.
Will this break the visual states though?
It will if you kept them. But with this approach, you will be dropping the #LoadingContentPresenter
setters, to handle it in the code-behind.
By the time I did a behavior that was walking the visual tree to determine if any parent was Thinking about it, we now have a much better approach : the It has the down side that application dev will have to think about it, but the advantage to be usable not only in the |
How would we use the EffectiveViewportChanged event? I'm not sure I follow how this would work |
This gives you the rectangle that is currently visible for any |
Replaced by #1002 |
GitHub Issue (If applicable): #
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Internal Issue (If applicable):