Unable to Customize Windows NavigationViewItem due to NavigationViewItemViewModel Protection Level #26953
Labels
area-architecture
Issues with code structure, SDK structure, implementation details
custom-handler
platform/windows 🪟
t/bug
Something isn't working
Milestone
Description
I'm working on configuring my own handler for the Windows MauiNavigationView, so that way I can customize how one specific tab of my navigation view appears. The problem is: I can't fetch the internal rendering for the ViewItem because of the accessibility level for NavigationViewItemViewModel. I can workaround this issue at the moment using reflection, but I'd ideally be ready for NativeAOT early by coding without reflection in mind.
Notably, this class is referenced quite often throughout the platform-specific code for Windows, which tells me that it should not be an internal class, if this code shows that it is dependent for various other publicly accessible operations. Or there should be an INavigationViewItemViewModel class provided. Regardless of the solution, I do believe this is a bug.
I'd be willing to make a simple PR changing the accessibility here, but I'd like to run it by the community since I'm a newer developer to .NET MAUI, and I could be doing something wrong here; so I want to ensure this is the best solution to what I'm doing specifically.
https://github.com/dotnet/maui/blob/main/src/Core/src/Platform/Windows/NavigationViewItemViewModel.cs#L78
Steps to Reproduce
Even better: Some reproduction code.
Link to public reproduction project repository
No response
Version with bug
9.0.21 SR2.1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: