Navigating Between Pages in .NET MAUI [6 of 8] | .NET MAUI for Beginners

dotnet · 166K views · 2022 · 17:02

Open on YouTube

Software architecture & designWeb developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when they are new to .NET MAUI and need a worked example of Shell navigation and passing parameters between pages with MVVM and the Community Toolkit.

Recommended by 1 people across 1 different months, 2022 to 2023.

What it is

A 17-minute beginner tutorial from the official dotnet channel, presented by James Montemagno, on Shell navigation in .NET MAUI. It covers URL-style routes with GoToAsync and passing full objects between pages as part of the MAUI for Beginners series (part 6 of 8).

What people said

Recommends Zidd · 2022-11 · Stack Overflow · on “Passing a property between pages using the Shell, Property Binding, and ViewModels on .NET MAUI”

On a MAUI app, I'm trying to pass a value from one page to another through their respective ViewModels, but it's not working and for the life of me I can't figure out why. Source VM: [RelayCommand] public async Task GetAdvertDetailsPageAsync(int advertId) { await Shell.Current.GoToAsync($"{nameof(AdvertDetails)}?AdvertId={advertId.ToString()}"); } Destination VM: [QueryProperty("AdvertId", "AdvertId")] public partial class AdvertDetailsVM : ObservableObject { [ObservableProperty] public string advertId; public AdvertDetailsVM(IMyHttpClient httpClient) { LoadAdvertAsync(Convert.ToInt32(AdvertId)); } Destination ContentPage: public partial class AdvertDetails : ContentPage { public AdvertDetai

Cites wojtek · 2022-10 · Stack Overflow · on “Navigation in .Net maui doesn't work - TapgestureRecognizer”

I am new to .net maui. I want to make navigation between my Main page and other pages. I used this tutorial on yt: [this video] but it doesn't work. I don't know what should i do. Maybe TapGestureRecognizer is used bad or a frame should be in other place. (I use CommunityToolkit.Mvvm.) Should I use something diffrent than TapGestureRecognizer? And if yes how? Can you also suggest any tutorials that could help me? I think that problem may be also related to my method where i try to navigate - MenuListViewSelectedItem in ViewModel. Link to git: [LINK] This is my code: Main Page xaml: <CollectionView ItemsSource="{Binding GameDescription}" Grid.Row="2" Margin="9,40" SelectionMode="None"> <Collection

Cites Johan van der Merwe · 2022-12 · Stack Overflow · on “XAML binding to model not updating UI”

I am new to .Net Maui. I have follow James Montemagno's video tuorial: [this video] on navigating between pages. I can successfully navigate from one page to the next and also send a complex data object as a parameter. However, on the new page, I want to use the parameter to fetch objects via a webservice in my ViewModel, and bind the xaml to the newly fetched objects. At first I tried this in the ViewModels' constructor, but the parameters where still null inside the constructor. I then invoked an event that fired when the property I am binding to changes partial void OnLoginResultChanged(LoginResult value) . From there I call an async Task to fetch the objects from the webservice and try and bi

Cites SubwayToVenus22 · 2023-03 · Stack Overflow · on “GoToAsync Causes ArgumentOutOfRangeException”

Im creating a .NET MAUI app and following along with a guide on youtube ( [this video] ) but altering what the app shows, but the functionality is mostly the same. When I add navigation to a page and execute that code to go to the new page, I get ArgumentOutOfRangeException and the break mode screen comes up in Visual Studio 2022. Im using the MVVM community toolkit version 8.1 (latest). Im not passing any values from page A to new page B (I will once I sort this error out). My ViewModel for page A contains a [RelayCommand] bound to a button on my UI (this is working fine) but at the end of this [RelayCommand] there is a call to a method which then takes you to the next page (intentionally, as th