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
Ability to turn off "TopPadding" in NavigationView #47
Comments
@jamers99 Thank you for the feature request, I agree with you that the top of NavigationView lacks easy customization opportunities. We're planning to add an overwritable ThemeResource to address this. A ThemeResource will allow us to keep the current default padding and also let app developers choose custom values, including 0. This work was tracked by an internal bug (filed before we went open source). That bug is now resolved and we'll track the request here on GitHub. |
Broadening this feature request slightly. We should provide new ThemeResources for both the TopPadding on NavigationView.Content and HeaderContent margin on NavigationView.Header. |
Maybe the platform could provide a TitlebarHeight which can be consumed in XAML without having to query the OccludedRect - and this value updates on DPI changes? This value could then be used by the NavigationView top padding when Titlebar is extended, and overridden by a non empty/null value in the app resources? |
Very brief spec for this feature request is now available here: microsoft/microsoft-ui-xaml-specs#8 |
Modest starter for whoever picks up this work: https://github.com/microsoft/microsoft-ui-xaml/tree/user/cglein/navViewTopPadding |
Hi guys, is this still targeting 2.2? |
While @RBrid would know with more certainty, I believe we are still targeting WinUI 2.2 |
Reopening the issue to make sure I update documentation. @RBrid, can you double-check that the Release Checklist is accurate? |
The WinUI team has completed the spec for this feature
Proposal: Ability to turn off "TopPadding" in NavigationView
Summary
We want to have the NavigationView all the way to the top with ExtendViewIntoTitleBar false.
Here is a screenshot of what I want:
Rationale
I looked at the code for this and found that to achieve this I can put a small margin on my NavigationView and it works. I should not have to do this kind of hack to achieve a simple customization like this.
The logic can be found in
microsoft-ui-xaml/dev/NavigationView/NavigationView.cpp
atNeedTopPaddingForRS5OrHigher
Functional Requirements
A property on the NavigationView called something like "EnableAutomaticPadding"
Usage Examples
The default of the property would be true, so to turn it off I could just set it to false.
Release Checklists
Prerelease readiness
Stable release readiness
The text was updated successfully, but these errors were encountered: