unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.88k stars 716 forks source link

[Docs] typo in Native Frame navigation doc pages #18494

Closed Xiaoy312 closed 2 days ago

Xiaoy312 commented 3 days ago

What would you like clarification on

SystemNavigationService is not existing... probably meant SystemNavigationManager

Concern

None

Affected platforms

No response

Additional info

possible origin of error?: doc\articles\controls\CommandBar.md related sample initial pr: https://github.com/unoplatform/uno/pull/5457/files related doc initial pr: unoplatform/Uno.Samples@da251b0 (#44)

Xiaoy312 commented 3 days ago

a discord user complained that said class didnt exist at the time, i thought it was some legacy class that was deprecated, & replied that these pages were outdated it also doesnt help that https://github.com/microsoft/WindowsAppSDK/issues/2398 was adding the confusion

agneszitte commented 3 days ago

a discord user complained that said class didnt exist at the time, i thought it was some legacy class that was deprecated, & replied that these pages were outdated it also doesnt help that microsoft/WindowsAppSDK#2398 was adding the confusion

Related answer on Discord for reference: https://discord.com/channels/1182775715242967050/1182776377955602632/1294474205420720169

regarding some of you questions:

  • for the theme-switching, you only need to set the ActualTheme of the XamlRoot.Content. you can find an example of it, here: https://github.com/unoplatform/uno.toolkit.ui/blob/main/samples/Uno.Toolkit.Samples/Uno.Toolkit.Samples.Shared/Shell.xaml.cs#L92 (note that this setup doesnt persist the theme between app launches. if you are in need of that features, you would need that UseThemeSwitching service or have to implement your own)
  • yes, both these pages are somewhat outdated unfortunately.
  • SystemNavigationManager is an api from uwp, that no longer exists in winui. i would assume that you are using a winappsdk(winui) project, in such case, just exclude the relevant code for the windows target with:

    if HAS_UNO

    SystemNavigationManager...

    endif