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

Proposal: Add some animations to Expander #135

Open
ShankarBUS opened this issue Jul 12, 2020 · 8 comments
Open

Proposal: Add some animations to Expander #135

ShankarBUS opened this issue Jul 12, 2020 · 8 comments
Labels
enhancement New feature or request

Comments

@ShankarBUS
Copy link
Contributor

Summary

This proposal is to add some animations to the Expander control as in WCT

Rationale

The only parts this library missing from WinUI are the nice little animations in it.
While animating other controls might be hard, animating the Expander control is relatively easy.
I know this due to limitation in WPF and this is how it works. "But it is not impossible."

See this codeproject article : Customizing WPF Expander with ControlTemplate by XiaoChuan Yu. A basic implementation like this would be appreciated

Screenshots

Expander from WCT
Expander_WCT

Expander from this library
Expander_MW

Additional Context

I may be a little biased since I need this for one of my apps. But no would say they don't need fluid animations.
Implementing this will be a nice addition to this library.
If you are okay I will work on this and submit a PR for this

@Kinnara
Copy link
Owner

Kinnara commented Jul 12, 2020

Good idea. Is there a "standard" expand/collapse animation in UWP/WinUI that we can borrow, to make our animation as native as possible?

@ShankarBUS
Copy link
Contributor Author

There is no expander in WinUI AFAIK, it's from the Windows Community Toolkit (aka WCT), the presets could be there.

@ShankarBUS
Copy link
Contributor Author

ShankarBUS commented Jul 12, 2020

I have some questions :

  • Should the header be rotated when in Left/Right Expand mode?
  • Should we match the the UI from WCT? Or keep the current and just add animations? (IMO the UI in this lib is far better than the one in WCT)
  • They don't have separate styles for each direction, they have a single template for all directions. Any ideas?
  • In their Implementation the arrow always points towards the header content and will turn clockwise and perpendicular to the header content, In your implementation the arrow will point towards expand direction and turns 180 degrees when expanded (I personally like your implementation), Any ideas?

@Kinnara Kinnara added the enhancement New feature or request label Jul 12, 2020
@ShankarBUS
Copy link
Contributor Author

ShankarBUS commented Jul 12, 2020

Hey @Kinnara,
Are you planning on implementing this, should I open a PR? Are you gonna implement it yourself?
I have done half of the job in commit 8aaee4b in my fork, am I allowed to open a PR?

@Kinnara
Copy link
Owner

Kinnara commented Sep 22, 2020

If this proposal is accepted, we can port the control (or just the animations) over.

@ShankarBUS
Copy link
Contributor Author

ShankarBUS commented Sep 22, 2020

That's why I closed the related PR.

I don't have a solid decision on whether to port the whole API or just the animations.

Since most of the apps already use the WPF expander, creating a custom style would be a good option. But that shouldn't stop innovation.

IMO, We must go with porting the whole control.

@ShankarBUS
Copy link
Contributor Author

@Kinnara, the proposal was accepted, a PR was made and got mergerd 🎉🥳

microsoft/microsoft-ui-xaml@ce84da3

What about now?

@Kinnara
Copy link
Owner

Kinnara commented Nov 11, 2020

We probably want to first update the styling of the WPF Expander to match the WinUI one. I'll need to take a closer look to see what's possible and what's not.

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

No branches or pull requests

2 participants