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 UseScroller property to NavigationView to control IsDynamicScrollViewerEnabledProperty #776

Closed
wants to merge 2 commits into from

Conversation

Akizon77
Copy link

@Akizon77 Akizon77 commented Oct 8, 2023

  • Feature

Added UseScroller property to NavigationView to control IsDynamicScrollViewerEnabledProperty of NavigationViewContentPresenter(NVCP).(I conflicted with NVCP DynamicScrollViewer when designing ItemsControls. I tried many methods but failed to solve it (including adding UseScroller attribute, the state was not passed to NVCP). Finally, I found IsDynamicScrollViewerEnabled = ScrollViewer.GetCanContentScroll() by downloading the source code and debugging continuously;(NavigationViewContentPresenter.cs,Line 177) only to find out that you have considered this situation. Navigation documentation only describes how to navigate, no more detailed information, plus I have not considered the need to add AP to the Page, so I spent the whole day debugging and thinking.

Although I am a beginner of WPF, I think Frame should default without ScrollViewer. Previously, when doing some Win UI3 projects, Frame is without ScrollViewer, just a Frame.

The WPF UI project is one of my favorite open source projects, and I learned a lot from its source code (there is almost no systematic C#teaching in our country, let alone WPF). I hope this project gets better and better, and I hope to contribute to the community with my limited knowledge.

…llViewerEnabledProperty of NavigationViewContentPresenter
@Akizon77 Akizon77 requested a review from pomianowski as a code owner October 8, 2023 15:10
@cla-bot
Copy link

cla-bot bot commented Oct 8, 2023

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Akizon77 on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added.

@@ -167,7 +167,7 @@ protected virtual void OnNavigated(NavigationEventArgs eventArgs)
return;
}

IsDynamicScrollViewerEnabled = ScrollViewer.GetCanContentScroll(dependencyObject);
//IsDynamicScrollViewerEnabled = ScrollViewer.GetCanContentScroll(dependencyObject);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
//IsDynamicScrollViewerEnabled = ScrollViewer.GetCanContentScroll(dependencyObject);

@@ -24,10 +24,10 @@
<Setter Property="Padding" Value="0" />
<Setter Property="OpenPaneLength" Value="320" />
<Setter Property="CompactPaneLength" Value="40" />
<Setter Property="ScrollViewer.CanContentScroll" Value="False" />
<!--<Setter Property="ScrollViewer.CanContentScroll" Value="False" />
Copy link
Member

Choose a reason for hiding this comment

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

If unnecessary, it is better to remove it.

@@ -15,6 +15,22 @@ namespace Wpf.Ui.Controls;

public partial class NavigationView
{
/// <inheritdoc/>
Copy link
Member

Choose a reason for hiding this comment

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

This inheritdoc does not lead to anything, it has no documentation in INavigationView. Additionally, it has no equivalent in WPF or Win UI. Which makes the name quite unintuitive.

@IvanDmitriev1
Copy link
Collaborator

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants