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 resource for topmode CustomContentPane minimum width #2905

Conversation

marcelwgn
Copy link
Collaborator

Description

Adds themeresource for ContentPane minimum width in top displaymode

Motivation and Context

Closes #2890

How Has This Been Tested?

Tested manually

Screenshots (if appropriate):

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jul 14, 2020
@@ -231,7 +231,8 @@
<x:Double x:Key="PaneToggleButtonWidth">40</x:Double>
<x:Double x:Key="NavigationViewCompactPaneLength">40</x:Double>
<x:Double x:Key="NavigationViewTopPaneHeight">40</x:Double>

<x:Double x:Key="NavigationViewTopModeContentPaneMinWidth">48</x:Double>
Copy link
Contributor

Choose a reason for hiding this comment

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

We should strive to be consistent as best as possible with our theme resource naming here. As far as I can see, only the theme resource NavigationViewTopPaneHeight uses a slightly different prefix for the specific NavigationView theme resources in top pane display mode. The overwhelming majority uses the prefix "TopNavigationView" so I suggest we should use that prefix here as well. "NavigationViewTopMode" is yet another new prefix here and we should avoid that.

(Out of scope here but mentioned for completeness: For consistency, we should also add a TopNavigationViewPaneHeight theme resource later when, for example, the XAML resource lookup system supports a level of indirection to avoid a breaking change.)

The naming "NavigationViewTopModeContentPaneMinWidth" also seems to suggest to me that the NavigationView has a content pane with its min width configurable here. As that is not the case (there is only one pane), we should be careful how we name it here. The ContentControl placed inside this grid column is named "PaneCustomContentOnTopPane" so perhaps we could name it TopNavigationViewPaneCustomContentMinWidth?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Very good point. I like "TopNavigationViewPaneCustomContentMinWidth", so I've updated the code now to use that name. Thanks for the suggestion!

(Out of scope here but mentioned for completeness: For consistency, we should also add a TopNavigationViewPaneHeight theme resource later when, for example, the XAML resource lookup system supports a level of indirection to avoid a breaking change.)

Should there be/is there a tracking issue for that?

Copy link
Contributor

@Felix-Dev Felix-Dev Jul 14, 2020

Choose a reason for hiding this comment

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

I do plan to create a tracking issue for the XAML resource lookup system soon (I'm aware I'm already a few days late here 😅) but there is none for ensuring constistency in the naming scheme of the existing NavigationView theme resources (like NavigationViewTopPaneHeight vs TopNavigationViewPaneHeight). We should create one (as otherwise this can fall off the radar pretty quickly). Feel free to create a tracking issue for this if you agree, @chingucoding 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created #2906 for the navview resource naming scheme.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree that we should try to be as consistent as possible, but it looks like we already have some inconsistencies in the naming and we have to be careful about changing the naming since that is potentially a breaking change. Lets try to follow the pattern as much as possible. @YuliKl and @anawishnoff as FYI.

@StephenLPeters StephenLPeters 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 Jul 15, 2020
@StephenLPeters
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StephenLPeters
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -113,7 +113,7 @@
<VisualState x:Name="OverflowButtonWithLabel" />
<VisualState x:Name="OverflowButtonNoLabel">
<VisualState.Setters>
<Setter Target="TopNavOverflowButton.Style" Value="{ThemeResource NavigationViewOverflowButtonNoLabelStyleWhenPaneOnTop}" />
<Setter Target="TopNavOverflowButton.Style" Value="{ThemeResource TopNavigationViewPaneCustomContentMinWidth}" />
Copy link
Contributor

Choose a reason for hiding this comment

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

TopNavigationViewPaneCustomContentMinWidth [](start = 106, length = 42)

Am i missing something here or is this change setting a style to a double?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure how that slipped in, should be fixed now.

@StephenLPeters
Copy link
Contributor

/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:

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.

Question: Why does NavigationView enforce min width for custom content pane
5 participants