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

Add New NavView VisualStateGroup #4659

Merged
merged 15 commits into from
Apr 5, 2021

Conversation

karkarl
Copy link
Contributor

@karkarl karkarl commented Mar 26, 2021

Description

  • Add PaneOverlayGroup to control PaneOverlay and PaneNotOverlay vistual states
  • Set background to transparent when in compact closed, and acrylic when in compact overlay
  • Lift SplitView from WUXC to add cornerRadius templateBindings to PaneRoot
  • Set OverlayCornerRadius to SplitView during PaneOverlay state
  • Update NavView pane border to have rounded corners on overlay

Motivation and Context

How Has This Been Tested?

Visual verification

Screenshots (if appropriate):

image

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Mar 26, 2021
@ranjeshj ranjeshj added area-NavigationView NavView control team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Mar 26, 2021
@ranjeshj ranjeshj requested review from teaP and YuliKl March 26, 2021 15:43
@karkarl
Copy link
Contributor Author

karkarl commented Mar 26, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@karkarl
Copy link
Contributor Author

karkarl commented Mar 29, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@karkarl
Copy link
Contributor Author

karkarl commented Mar 31, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="PaneOverlay">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These VisualState names don't seem correct to me. @ranjeshj and @MikeHillberg for naming, maybe PaneOverlaying and PaneNotOverlaying

@karkarl
Copy link
Contributor Author

karkarl commented Mar 31, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj
Copy link
Contributor

ranjeshj commented Apr 1, 2021

@karenbtlai you need to merge in master to fix the key mismatch errors.

@karkarl karkarl force-pushed the user/karenlai/NavViewOverlayStateGroup branch from dacd169 to 47f4a3a Compare April 1, 2021 15:51
@karkarl
Copy link
Contributor Author

karkarl commented Apr 1, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@karkarl
Copy link
Contributor Author

karkarl commented Apr 1, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

if (splitView.DisplayMode() == winrt::SplitViewDisplayMode::CompactOverlay || splitView.DisplayMode() == winrt::SplitViewDisplayMode::Overlay)
{
winrt::VisualStateManager::GoToState(*this, L"PaneNotOverlay", true /*useTransitions*/);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very comfusion here.
From your code, Likely PaneNotOverlay and PaneOverlay only happens when DisplayMode is CompactOverlay or Overlay.
So we should have 3 visual states other than 2:

  1. DisplayMode is not CompactOverlay or Overlay
  2. DisplayMode is ?Overlay, and Pane is closed
  3. DisplayMode is ?Overlay, and Pane is opened

Don't use PaneNotOverlay/Overlay, it's easy to mess up with the term: CompactOverlay or Overlay in splitview setting.

It's better to have the LeftNav in the name, for example: Pane???OnLeftNavigationView

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added you to the email thread discussing the naming

@StephenLPeters
Copy link
Contributor

StephenLPeters commented Apr 1, 2021

static constexpr auto c_shadowCasterEaseOutStoryboard = L"ShadowCasterEaseOutStoryboard"sv;

Looks like these storyboards aren't referenced from the code behind anymore. Can we delete this? If so, can we remove the name from the storyboard definition as well? (We can only remove the name if we haven't published the storyboard in a release yet)


Refers to: dev/NavigationView/NavigationView.cpp:101 in 3e2d182. [](commit_id = 3e2d182, deletion_comment = False)

@StephenLPeters
Copy link
Contributor

            UnsetDropShadow();

Don't we need to keep the shadow around until the transition animation has finished?


Refers to: dev/NavigationView/NavigationView.cpp:4086 in 3e2d182. [](commit_id = 3e2d182, deletion_comment = False)

@karkarl
Copy link
Contributor Author

karkarl commented Apr 2, 2021

            UnsetDropShadow();

Don't we need to keep the shadow around until the transition animation has finished?

Refers to: dev/NavigationView/NavigationView.cpp:4086 in 3e2d182. [](commit_id = 3e2d182, deletion_comment = False)

You're right. I reverted the bit with the event listener.

@karkarl
Copy link
Contributor Author

karkarl commented Apr 2, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@karkarl
Copy link
Contributor Author

karkarl commented Apr 2, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@StephenLPeters StephenLPeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@karkarl
Copy link
Contributor Author

karkarl commented Apr 5, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

</Storyboard>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="PaneOverlaying" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do a testing that if the default NavigationVIew is set to minimal or compact in Xaml, will PaneNotOverlaying
code still called?
Because your default state is PaneOverlaying, and I want to make sure PaneNotOverlaying working in some default settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does. I confirmed it with different test pages where minimal and compact is the default.

@karkarl karkarl merged commit aadd350 into master Apr 5, 2021
@karkarl karkarl deleted the user/karenlai/NavViewOverlayStateGroup branch April 5, 2021 21:47
@ghost
Copy link

ghost commented May 3, 2021

🎉Microsoft.UI.Xaml v2.6.0-prerelease.210430001 has been released which incorporates this pull request.:tada:

Handy links:

Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Dec 6, 2023
Kinnara added a commit to Kinnara/ModernWpf that referenced this pull request Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NavigationView NavView control team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants