-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Refactor TransitioningContentControl #11326
Conversation
Now has two `ContentPresenter`s between which it transitions. Fixes #11167
Not really sure we should be doing this, but the previous version had it (though it was using a mutable object as a `StyledProperty` default value which means the instance was shared: bad).
I tested this PR and it still flickers (GIF may take some time to load): Also the new behavior of starting both animations at the same time is different as to what is shown in the docs: https://docs.avaloniaui.net/docs/controls/transitioningcontentcontrol |
I tend to agree. You could argue about what a TCC should do. I had been pretty happy with the old function also because you were able to also transition from/to null-content (skipping the null-content transition) by creating your own CrossFade (https://github.com/llfab/Samples/tree/main/CrossFade). It would be great to have both (transition-out then transition-in OR transition both at the same time) but for keeping the semantic compatibility I would give the old behavior priority. |
Strange, I'm definitely not seeing that here; I'm guessing it's a timing issue. Sounds like the problem with page transitions still needs to be solved correctly but for that I need to wait for @kekekeks incoming changes.
Yeah that's because the docs still show the old
If such a thing is needed IMO that setting should be put in the transition itself. |
That would be a way, yes. However, the old CrossFade had both transitions concurrently using |
Sorry, I don't understand the question. The intention of a page transition was always to transition from one page to another, the page transition itself can decide to do that in any way it likes. It can transition one page out and then the other one in, it can decide not to transition on some condition. I don't think it "strongly depends on how the transitions are called" because the transition should always called in one way: " The original implementation of |
Actually, regarding handling |
That sounds good. If it's possible to give the control to the transition, that would be the best solution. I just had the impression that the "old" way had been there for a reason, having been surprised myself when I saw that |
Nice. One problem I had when creating above mentioned custom CrossFade was, that I needed to use a dummy animation (1 msec) for the null content otherwise the final state was wrong. So yes, addressing from/to null would be much appreciated. Also it makes sense because that seems not like just an edge case. |
I also tested using control catalog:
Hope that helps. Windows 10, Nvidia Quadro T2000 |
Create an immutable crossfade class which can safely be used as a default styled property value.
Actually this isn't going to be possible without some nasty hacks as the "current" content presenter will exist and have |
Not a problem so much, as long as one can find out in a custom transition (similar to my custom CrossFade) that there is null-content. For myself the workaround using a 1 msec dummy animation then is good enough. |
You can test this PR using the following package version. |
That workaround shouldn't be necessary, I'll make sure the |
Don't set `FillMode` because the value will get stuck.
Yeah I think this is a problem with the renderer and animations being out of sync. @kekekeks is working on a fix for this.
This was caused by the custom transition setting |
You can test this PR using the following package version. |
todo: test if reactiveui navigation still works |
@maxkatz6 there's a test app in |
@grokys no, ReactiveUIDemo should be enough. Thanks. |
I just tested out a PR build made last night for another issue and tried @kekekeks - Are you still working on a fix for that? |
@laolarou726 not quite sure what you mean, can we get a repro? If not, at least a full stacktrace might help. |
What does the pull request do?
As described in #11167,
TransitioningContentControl
had two problems:Turns out that although there remains a problem which caused 1, fixing 2 actually fixes 1 in this case.
This PR fixes 2 by making
TransitioningContentControl
host twoContentPresenter
s and transitioning between them.Breaking changes
Any custom templates for
TransitioningContentControl
will need to be updated to host twoContentPresenter
s. If that's not done, the control will still work, but no transitions will take place.Fixed Issues
Fixes #11167