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

NavigationViewTemplateSettings is missing OpenPaneWidth #6682

Closed
1 of 2 tasks
michael-hawker opened this issue Feb 4, 2022 · 5 comments · Fixed by #7341
Closed
1 of 2 tasks

NavigationViewTemplateSettings is missing OpenPaneWidth #6682

michael-hawker opened this issue Feb 4, 2022 · 5 comments · Fixed by #7341
Assignees
Labels
area-NavigationView NavView control team-Controls Issue for the Controls team wct
Milestone

Comments

@michael-hawker
Copy link
Collaborator

Describe the bug

The NavigationView style references this binding:

OpenPaneLength="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OpenPaneWidth}"

However this property does not exist on the NavgationViewTemplateSettings class: https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.navigationviewtemplatesettings

(I'm not sure how these are generated in the code base the h/cpp files with those names are empty.)

In either case, there is some mismatch between the style and the properties which should be resolved as this will cause binding reflection errors at runtime.

This is also another reason why improving x:Bind behaviors like #2508 #2237 would be valuable.

Steps to reproduce the bug

Copy NavigationView template into an app project, get warning about property on NavigationViewTemplateSettings not existing

Expected behavior

No errors in template

Screenshots

image

NuGet package version

Microsoft.UI.Xaml 2.7.0

Windows app type

  • UWP
  • Win32

Device form factor

No response

Windows version

No response

Additional context

No response

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 4, 2022
@michael-hawker
Copy link
Collaborator Author

Also occurs again here:

Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.OpenPaneWidth}"

@marcelwgn
Copy link
Collaborator

The code for that property is auto generated based on the IDL file. You can find the definition of the properties for the template settings here: https://github.com/microsoft/microsoft-ui-xaml/blob/main/dev/NavigationView/NavigationView.idl#L127

The behavior you are describing is partially a bug indeed. The property is not included in non-prerelease versions of WinUI 2 and as such, the property is not available in WinUI 2.7. If you are using a pre-release, the property will be available.

@MikeHillberg Do you think the property can be made public now given how long it has been part of the pre-releases (first added in #5800, March 2021)?

@StephenLPeters
Copy link
Contributor

@ranjeshj I think we need to make this property public. this is pretty broken.

@StephenLPeters StephenLPeters added area-NavigationView NavView control team-Controls Issue for the Controls team labels Mar 4, 2022
@StephenLPeters StephenLPeters added this to the WinUI 2.8 milestone Mar 4, 2022
@StephenLPeters
Copy link
Contributor

@karenbtlai FYI

@StephenLPeters StephenLPeters removed the needs-triage Issue needs to be triaged by the area owners label Mar 4, 2022
@karkarl karkarl self-assigned this Mar 4, 2022
@kmahone kmahone assigned ojhad and karkarl and unassigned karkarl and ojhad Jun 16, 2022
@kmahone
Copy link
Member

kmahone commented Jun 27, 2022

@karenbtlai please take a look.

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 wct
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants