Repository navigation
Conversation
05c622f to
f2ec5cb
Compare
|
@kazo0 did you/Team see this PR? As I created for this need case the YouTube tutorial (currently only German localized but it has Transcripts for automatic Subtitles) I would have also some sourcecode I could use for this as its much simpler than the current approach. |
this did also fault the right-side toc
|
@kazo0 what do you say to this latest commits? for a beginner most of the "Advanced" docs for this are more "overloaded" as they are all utilizing the same sample apps solution which is with all of the nested areas (not speaking of routes in general!) quickly overwelming the reader. Its of course good to have one tutorial telling us, how we can set up a navigation with areas in one content like a grid with two rows etc. but its kind of ALL are like this, which makes it really hard to understand whats the endresult. also, the source code is (was last time I tryed to look it up beginning with it) not matching the tutorial, which disables the reader to make a local clone of the sample and take a look for things that had been left out or not well described. |
There was a problem hiding this comment.
Pull Request Overview
This PR improves the XAML navigation documentation by separating MVVM and MVUX approaches with tabbed content, adds visual guides for MVUX, and enhances the NavigationView documentation with additional context and TODO notes for future improvements.
Key Changes:
- Separated MVVM and MVUX specific guidance using dependent tabs throughout the navigation documentation
- Added visual content and step-by-step screenshots for MVUX approach
- Enhanced NavigationView documentation with better explanations and examples
Reviewed Changes
Copilot reviewed 11 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
doc/Learn/includes/mvux-approach.md |
New include file defining MVUX approach note for documentation |
doc/Learn/Navigation/includes/register-routes-mvvm.md |
MVVM-specific route registration code example |
doc/Learn/Navigation/includes/register-routes-mvux.md |
MVUX-specific route registration code example using Model instead of ViewModel |
doc/Learn/Navigation/includes/navigation-widgets-inline.md |
Shared widget navigation example code |
doc/Learn/Navigation/includes/navigation-showing-widgets-inline.md |
Widget display example for navigation data |
doc/Learn/Navigation/includes/navigation-data-inline.md |
Widget record definition for navigation examples |
doc/Learn/Navigation/includes/navigate-xaml-request.md |
Common navigation request explanation |
doc/Learn/Navigation/HowTo-NavigateInXAML.md |
Main navigation guide with MVVM/MVUX tabs and NavigationView content |
doc/Learn/Navigation/HowTo-NavigateBetweenPages.md |
Updated description and fixed typo |
doc/Learn/Navigation/Advanced/HowTo-UseNavigationView.md |
Enhanced NavigationView guide with better explanations and TODO note |
doc/Learn/Navigation/Advanced/HowTo-AdvancedPageNavigation.md |
Converted sections to use tabbed format for consistency |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@mtmattei you mentioned to improve the mvux - Navigation docs last week, would you like to check if you have improvements to be done here? |
| </ListView.ItemTemplate> | ||
| </ListView> | ||
| ``` | ||
|
|
There was a problem hiding this comment.
The use of Regions and NavigationView are covered by this: https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Navigation/Advanced/HowTo-UseNavigationView.html
And TabBar Navigation is here: https://platform.uno/docs/articles/external/uno.extensions/doc/Learn/Navigation/Advanced/HowTo-UseTabBar.html
How come we added this to specific XAML Navigation docs?
There was a problem hiding this comment.
@kazo0 Thanks for pointing to the existing docs.
They do cover the basics, but the gap I’m highlighting is very real — and showed up again in this recent Discord question
The user struggled with the same unclear aspects I encountered myself when learning Extensions Navigation with NavigationView. He even progressed further than I did before I ended up digging through the Samples source to understand how the system behaves. 😄
And as side note, he seems to also face HR problems with Navigation, where the HR Engine stated it would have been applyied but he stated it was not changing anything. Maybe the team could check with him, if it works now?
https://discord.com/channels/1182775715242967050/1182776377955602632/1445074184714846298
Region.Navigator confusion
The user also assumed Extensions Navigation supports a Frame-style navigator and tried:
uen:Region.Navigator="FrameNavigator"This is completely understandable because the documentation lists the property but only documents a single valid value:
Since the repository contains additional navigator implementations (e.g. FrameNavigator.cs, ControlNavigator.cs), it is natural to assume that other navigator names might be usable not just via Qualifiers.
Missing example: NavigationView + Regions + separate pages(file seperated) in NavigationView.Content
The current documentation presents navigation concepts only in isolation:
- imperative navigation
- Visibility-based region navigation
- nested ContentControl regions
- NavigationView examples without page separation
What’s missing is the combined, real-world scenario:
NavigationView + uen:Region.* + actual XAML pages
This is also the layout most developers instinctively expect, especially since Uno templates themselves use a separated-page structure. Without such an example, beginners cannot easily understand how the building blocks fit together.
This is why I suggested adding a simplified introductory step before repeating the SPA-style Visibility layout again:
| ### [MVVM Setup](#tab/mvvm) | ||
|
|
||
| - Add a new `Page` to navigate to, `SamplePage.xaml` | ||
| [!include [getting-help](../includes/mvvm-approach.md)] |
There was a problem hiding this comment.
I'm not sure I'm seeing why we need to separate between MVUX and MVVM Toolkit here. The syntax should be almost identical, shouldn't it? In both MVUX and MVVM we can just have a public partial class SampleViewModel
There was a problem hiding this comment.
it is almoast identical, which is why I would suggest to use the includes for the parts that are same.
But no, honestly from my POV, as I freshly started with Uno, every guide that was giving me a Mvux separated tab, I was so greatfull, because it allowed me to really see a validated approach and not leaving me hoping the compiler will not again hate me and make me fail.
Our Getting Started guides are meant for exactly this consumers, for those who do not know about the specifics that more expirienced Developers are meanwhile doing automatically. E.g. the simple public partial record instead of just leaving the internal class definition that can be used for Mvvm.
By the way, while the UnoFeatures are allowing Mvvm we do miss this topic completly in the docs, assuming them to know everything about it or where to look for it.
Just to give you an understandable example:
Uno Templated Mvvm based app MainViewModel:
public partial class MainViewModel : ObservableObject // <-- see "class" used !
{
private INavigator _navigator; // <-- should be readonly
[ObservableProperty]
private string? name;
public MainViewModel(
INavigator navigator)
{
_navigator = navigator;
GoToSecond = new AsyncRelayCommand(GoToSecondView);
}
public ICommand GoToSecond { get; }
private async Task GoToSecondView()
{
await _navigator.NavigateViewModelAsync<SecondViewModel>(this, data: new Entity(Name!));
}
}What we even should get for complete Mvvm usage:
public partial class DashboardViewModel : ObservableObject // <-- same here: see "class" used !
{
private readonly INavigator _navigator;
[ObservableProperty]
[NotifyCanExecuteChangedFor(nameof(NavigateSecondAsyncCommand))] // <-- missing
private string? name;
public DashboardViewModel(INavigator navigator)
{
_navigator = navigator;
NavigateSecondAsyncCommand = new AsyncRelayCommand(NavigateSecondAsync);
}
public IAsyncRelayCommand NavigateSecondAsyncCommand { get; }
[RelayCommand(CanExecute = nameof(CanExecuteNavigateSecondAsync))] // <-- missing
private async Task NavigateSecondAsync()
{
await _navigator.NavigateViewModelAsync<SecondViewModel>(this, data: new Entity(Name!));
}
private bool CanExecuteNavigateSecondAsync() // <-- (complete method) missing
{
return !string.IsNullOrWhiteSpace(Name);
}
}And now compare this to what we are getting with Mvux:
public partial record MainModel // <-- see "record" used !
{
private INavigator _navigator; // <-- also schould be readonly !
public DashboardModel(INavigator navigator)
{
_navigator = navigator;
Title = "Dashboard"; // sample used Toolkit, not sure if this is included without it
}
public string? Title { get; }
public IState<string> Name => State<string>.Value(this, () => string.Empty);
public async Task NavigateSecondAsync()
{
var name = await Name;
await _navigator.NavigateViewModelAsync<SecondModel>(this, data: new Entity(name!));
}
}So, no, even if it looks like duplication, as User it helps in those getting started and even more important a getting help section tabbed content to every differencing guides otherwhise you could assume its same, but as soon as we are connecting INavigation with parameter provided Arguments and not just a "Button.Command" without a Parameter, that potentially causes problems on user side, which we should target to prevent.
This would enhance the Docs independant of the extension its about, and make Mvux accessible to be used all over out uno apps. It is simply not the case that choosing Mvux you will only have it in e.g. MainModel, then instead have it in every other Model or even Service maybe (which nobody talks about if we maybe should do them also as record or when we should want to have class!) which potentially and realistically can use Http or anything else then no service.
So maybe see Navigation here as first example of what we should want to have the whole Extensions docs set up like -> Our User can choose Mvvm or Mvux? Then we should provide guidiance for implementing things in our VM or Model with both! 👍
because we (should) want them to be successfull and recommend it as efficiency providing, understandable and fluentlessly integrateable feature in our apps 🚀
|
|
||
| ### 2. Navigation.Data | ||
|
|
||
| #### [MVVM](#tab/mvvm/NavigationData) |
There was a problem hiding this comment.
I'm not sure I'm seeing why we need to separate between MVUX and MVVM Toolkit here. The syntax should be almost identical, shouldn't it?
Just need to define a view model that has a constructor parameter for the data
GitHub Issue (If applicable): closes #
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Mvvm specific guide, but when Mvux should be used, we have a slightly different syntax (...Model instead of ...ViewModel) and the Model could get assumed to be a class instead of a record.
No visual content beside the setup intro
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information
Internal Issue (If applicable):