dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

public EventArgs with internal properties #25563

Open axa88 opened 2 weeks ago

axa88 commented 2 weeks ago

Description

Both Microsoft.Maui.Controls.Page, NavigatedTo and NavigatedFrom events are public, and their EventArgs NavigatedToEventArgs, and NavigatedFrom are public, yet their sole property's PreviousPage and DestinationPage are internal making them inaccessible and the event less useful without the available arguments.

Steps to Reproduce

  1. open Microsoft.Maui.Controls.NavigatedFromEventArgs or Microsoft.Maui.Controls.NavigatedToEventArgs
  2. observe their corresponding Page properties are internal.

Link to public reproduction project repository

No response

Version with bug

8.0.91 SR9.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

iOS, Android, Windows, macOS, Other (Tizen, Linux, etc. not supported by Microsoft directly)

Affected platform versions

NA

Did you find any workaround?

No

Relevant log output

No response

jfversluis commented 2 weeks ago

So the ask here is to make the internal properties more public?

What would be the use of that? What is it that you're trying to do that you cannot do today?

axa88 commented 2 weeks ago

So the ask here is to make the internal properties more public?

Yes, if there isn't a hidden purpose i dont see.

What would be the use of that? What is it that you're trying to do that you cannot do today?

I was building a custom logging mechanism, Logging which in and of itself has many uses. But this part was marking the point of creation and destruction of pages to better understand where controls are being leaked. Arguable if everything worked, i want to use this data... but here we are.