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

Added SplitView VisualTransitions for OpenInlineRight and OpenInlineCompactRight states #6719

Merged
merged 3 commits into from
Aug 21, 2023

Conversation

LilyStilson
Copy link
Contributor

A fix for #3108.

Description

Changed default <SplitView /> template by adding there <VisualTransition /> for states OpenInlineRight and OpenInlineCompactRight.

<VisualTransition From="Closed" To="OpenInlineRight" />
<VisualTransition From="OpenInlineRight" To="Closed" />
<VisualTransition From="ClosedCompactRight" To="OpenCompactInlineRight" />
<VisualTransition From="OpenCompactInlineRight" To="ClosedCompactRight" />

Motivation and Context

This change is just for completeness of <SplitView /> component. I think MS didn't implemented those transitions because they never used them anywhere, so they never bothered to implement them. And I need to use that transition in my app, so I implemented them.

The issues it fixes are #3108, #2392 (which was closed without resolution) and Kinnara/ModernWpf#87

How Has This Been Tested?

Manually. Created a ResourceDictionary with the copy of the <SplitView /> DefaultTemplate. Then edited <VisualTransition From="Closed" To="OpenInlineLeft" /> for it to become <VisualTransition From="Closed" To="OpenInlineRight" />. Did the same for the OpenInlineCompactRight transition.
Then, merged that dictionary with a test project, tested and it worked, soo...

Screenshots (if appropriate):

Video showing the before and after fix:
https://user-images.githubusercontent.com/42270214/154005944-80429dae-2044-4679-859d-c9e19b68f3dd.mov

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 15, 2022
@ghost
Copy link

ghost commented Feb 15, 2022

CLA assistant check
All CLA requirements met.

@StephenLPeters
Copy link
Contributor

@LilyStilson It looks like there is an unintended animation component on the left side of the video around 1:09 time stamp. Do you understand the cause of that?

@StephenLPeters StephenLPeters added area-Animations area-SplitView team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Feb 28, 2022
@LilyStilson
Copy link
Contributor Author

@StephenLPeters Yes! Indeed, I noticed that too. My guess is that it tries to transition somewhere either to zero width of pane or there is something wrong with grid's definitions there... If there was a visual transition debug tool, I'd say with more confidence.

I tried different values, nothing worked for me. Still, I haven't tried adding keyframe time to the copy of visual state, so going to try that.

@LilyStilson
Copy link
Contributor Author

2022-03-01.16-40-49.mov

@StephenLPeters Fixed!

@LilyStilson LilyStilson changed the title Added VisualTransitions for OpenInlineRight and OpenInlineCompactRight Added SplitView VisualTransitions for OpenInlineRight and OpenInlineCompactRight states Mar 2, 2022
@Fritierkelle
Copy link

Fritierkelle commented Jul 16, 2022

Am i missing something?! I had to change "Value" from Lily's code as follows and now it works for me, if closing (From="OpenInlineRight" To="Closed"):

<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PaneClipRectangleTransform" Storyboard.TargetProperty="TranslateX"> <SplineDoubleKeyFrame KeyTime="{StaticResource SplitViewPaneAnimationCloseDuration}" KeySpline="0.0,0.35 0.15,1.0" Value="{Binding TemplateSettings.NegativeOpenPaneLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> </DoubleAnimationUsingKeyFrames>

@ojhad
Copy link
Contributor

ojhad commented Aug 17, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ojhad
Copy link
Contributor

ojhad commented Aug 18, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ojhad
Copy link
Contributor

ojhad commented Aug 21, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ojhad ojhad merged commit 98d2f69 into microsoft:main Aug 21, 2023
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants