No video

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

  Рет қаралды 119,997

dotnet

dotnet

2 жыл бұрын

Learn more ➡️ learn.microsof...
View full playlist: aka.ms/dotnet/...
Get Started with .NET in Visual Studio: aka.ms/dotnet/...
Welcome to the .NET MAUI for Beginners Series where you will learn the basics of building multi-platform apps with .NET MAUI for iOS, Android, macOS, and Windows from a shared C# code base. In this video, James shows off how to use the built-in navigation system of .NET MAUI to easily navigate between pages of the application with a URL based schema, and how to pass full objects as well.
Follow along: aka.ms/dotnet/...
4 Hour .NET MAUI Workshop: • Learn .NET MAUI - Full...
Follow James:
- James on KZbin: / jamesmontemagno
- James on Twitter: / jamesmontemagno
Links:
- .NET MAUI Self-guided Learning on Microsoft Learn: aka.ms/dotnetm...
- .NET MAUI Website: aka.ms/dotnetm...
- Install .NET MAUI: aka.ms/dotnetm...
- My Tasks Sample: aka.ms/dotnetm...
- .NET MAUI Documentation: aka.ms/dotnetm...
- .NET MAUI on GitHub: aka.ms/dotnetm...
- .NET MAUI Workshop: aka.ms/maui-wo...
- .NET Community Toolkit Docs: aka.ms/dotnetm...
- .NET Community Toolkit GitHub: aka.ms/dotnetm...
- More .NET Beginner Series Videos: dot.net/videos
- .NET KZbin - / dotnet
- .NET on Twitter - / dotnet
Corrections:
08:20 - [ICommand] is now [RelayCommand] in the final version of community toolkit for mvvm
14:35 - [ICommand] is now [RelayCommand] in the final version of community toolkit for mvvm
#dotnet #dotnetmaui #ios #android #windows #macos #csharp
🙋‍♀️🙋‍♂️ Get your questions answered on the Microsoft Q&A for .NET: aka.ms/dotnet-qa
🏫 Learn C#, F#, and .NET with free self-guided learning from Microsoft Learn: aka.ms/learndo...

Пікірлер: 83
@dotnet
@dotnet 2 жыл бұрын
Correction: 08:20 - [ICommand] is now [RelayCommand] in the final version of community toolkit for mvvm Correction: 14:35 - [ICommand] is now [RelayCommand] in the final version of community toolkit for mvvm
@LoopLearnings
@LoopLearnings 8 күн бұрын
I wish all, these frameworks are simpler like Microsoft Access from the development point of view. Obviously fantastic job by James but I am scratching my head every time i watch these videos.
@neofox2526
@neofox2526 Жыл бұрын
I come back to this video everytime i need to add a new page lmao
@drivetrainerYT
@drivetrainerYT 2 жыл бұрын
It’s simple: I see James quality footage - I like the vid and use the knowledge. Great explanations.
@silakanveli
@silakanveli 9 ай бұрын
It is just crazy how much overhead there is when I just want to create simple navigation..makes no sense. Absolutely over engineered
@Aweklin
@Aweklin 9 ай бұрын
I don't think your assertion is correct. It's perhaps the most intuitive I have seen. Kindly check, compare and contrast again, objectively.
@zikkrype
@zikkrype Жыл бұрын
I'm getting "Global routes currently can't be the only page on the navigation stack", and similar with relative path as well
@lebeluet
@lebeluet Жыл бұрын
Question: Why didn't you create the Views folder to place the "DetailPage.xaml" file in this folder ?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
Just how I organize my code. Some folks like a folder named Pages or Views
@autbeamukda9431
@autbeamukda9431 Жыл бұрын
I got breakmode when I tap the task so did I do something wrong ? :( System.NullReferenceException: 'Object reference not set to an instance of an object.'
@stevenkjames
@stevenkjames 6 ай бұрын
Cool!
@Tajemniczy
@Tajemniczy Жыл бұрын
Big thanks for this:). I was thinking about starting something with xamarin but from what I see this MAUI will be better because also I will have desktop apps ^^:)
@purplepanther4153
@purplepanther4153 Жыл бұрын
Text Field is null or Empty On DetailViewModel, I would like to get the value and pass to service to get the detail. How would I complish this.?
@Remusqs1
@Remusqs1 Жыл бұрын
The Go Back button is actually unnecessary in this case. It seems that the build-in navigation of Maui implements an "Auto Go Back" witch actually has a better and smoother transition
@enricoroselino7557
@enricoroselino7557 Жыл бұрын
im stuck on third page, and cant go back to prev page... confused af
@androidsavior
@androidsavior 6 ай бұрын
What if i the details page needs to pull the details from the server and show them in the view ? shall i call the server in the constructor of the view model or what ?
@alevinciius
@alevinciius Жыл бұрын
Obrigado. Deus te abençoe
@stevenkjames
@stevenkjames 6 ай бұрын
Cool
@ajonescouk
@ajonescouk Жыл бұрын
Really useful for someone coming from MVVM in WPF, thank you! One question - is there any tool that will parse the project and create a navigation map for reference? Seems a tool like that would be useful for complex projects.
@mayori-engineering-hub
@mayori-engineering-hub 7 ай бұрын
Cool! However, most interested if you can tell is you can access incoming sms's or texts from the android or ios , or either you can use the camera and read QR's , do you have that capabilities in MAUI ..?????????
@scara1701
@scara1701 3 ай бұрын
Are we not breaking the principle of MVVM by using Shell in the viewmodels for navigation? The viewmodel seems to be no longer independant from the UI framework.
@muddy11112
@muddy11112 Жыл бұрын
Very Helpful thank you
@jonathanj2666
@jonathanj2666 Жыл бұрын
When i debug on an actual android phone and attempt to klick the text string to get to the detailpage i get an error saying the "application is in break mode", but i can't seem to fix it. Any suggestions?
@hungchip
@hungchip 7 ай бұрын
where i can read document at 11:46 (Transfer/Pass Variable type of Class.cs? And how to read/get/show it from Form Receive?
@GAMacky
@GAMacky Жыл бұрын
Great video. I just discovered an issue that I'm not sure how to resolve. The query parameter passed into the new page will not set to the query properties in the ViewModel until after the constructor of the viewmodel is completed. This means that I can't get any data to load inside constructor. For example, I pass an itemId from the collectionView page to the detail page, I'm not able to load the item object using the itemId until after the constructor is completed. So this means I can't use the community toolkit's [ObservableProperty] as I'll need to customize the set method on the query parameter property to load the item using the newly set itemId.
@MrJorgeandres12
@MrJorgeandres12 Жыл бұрын
I had the same issue, what I have done is load the data in the ApplyQueryAttributes() function, so you will load the data once the query parameters be set
@liemnguyen3088
@liemnguyen3088 Ай бұрын
How to handle OnNavigatedTo of DetailPage, Thank!
@faridulhuk1248
@faridulhuk1248 Ай бұрын
Hi its nice explaination of page navigation. i have some problem - when navigation from login page to Main page and to Order Page where i have three tabs. when i press back button from the third tab. i have problem in coming back to main page. any idea why it cannot back to main page
@afgdfdgdfddf42
@afgdfdgdfddf42 Жыл бұрын
Swipe does not work under Windows machine. But it works when I choose Android. Maui early days with some bugs?
@ITSligoPaul
@ITSligoPaul Жыл бұрын
At what stage in the MMVM lifecycle does resolution of the Query Property in the View model occur?
@kufena
@kufena 20 күн бұрын
Just going through all this, 2 years later. Not sure if there's a more modern intro somewhere, but anyway, I got the back button for free - it was just there 🤷‍♂
@user-px4dw3bs9u
@user-px4dw3bs9u 3 ай бұрын
Why not use the Item Tapped event method to navigate to DetailPage?
@sinsedrix
@sinsedrix 4 ай бұрын
Navigation seems so broken on windows. Mixing GoToAsync and PushAsync has hazardous behaviour. Back shell button works when it want. When navigation stack is over 2 element, app crashes. Ambiguous routes problem is recurrent. Would you consider making a new tuto about navigation with more use cases?
@risesandhineempowerment
@risesandhineempowerment Жыл бұрын
Hey James - great lesson thanks and got it all working. What I can't work out how to do is to detect when the page is navigated away from using the back arrow at the top of the screen. I've tried every event I can find but none of them seem to fire. Not sure what I'm doing wrong. Thanks 😊
@slimdridi2740
@slimdridi2740 2 жыл бұрын
and how to create dialog with a password type in blazor maui
@faranahmadk7401
@faranahmadk7401 9 ай бұрын
Hi James, I like all your videos But I have question. Is it possible to pass data to two different pages at the same time. How to do it ? I tried it but it goes to the first page then second page but I just want to pass the data without navigation. Please guide.
@mugileeshwaranj.s8484
@mugileeshwaranj.s8484 4 ай бұрын
How to handle navigation in non UI classes, i have to use navigation inside the class which is inside andriod folder..
@bodyavl
@bodyavl Жыл бұрын
Is there any way to pass collections between pages? Or raise some method from viewmodel when it's been navigated to?
@1akemper
@1akemper Жыл бұрын
I would love to know the view model nav too
@JamesMontemagno
@JamesMontemagno Жыл бұрын
You can pass them as data properties - learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/navigation?view=net-maui-7.0#pass-data
@forum_warrior_X
@forum_warrior_X Жыл бұрын
Please somebody explain to me, why? WHY does every video about learning anything must contain that annoying idiotic background music which makes it harder to concentrate on speech? Thank you.
@andrewbpc
@andrewbpc Жыл бұрын
It's better than indian programming tutotrial with background noises)
@light-water
@light-water Жыл бұрын
That was my comment, I actually couldn't follow along because of the background music.
@prestigiousaristocracy4232
@prestigiousaristocracy4232 Жыл бұрын
@@andrewbpc 🤣🤣🤣🤣
@strictnonconformist7369
@strictnonconformist7369 Жыл бұрын
I'd suggest it be removed for the sake of Accessibility, as Microsoft in many aspects tries to provide for that. Myself, I have a degenerative inner ear disorder also slowly destroying my hearing, and difficulty processing speech anyway. I'm calling on James to have no background music for that reason.
@akashsoni1530
@akashsoni1530 7 ай бұрын
This navigations works fine on the Emulator but when I use the same app on MI K50i phone the navigation doesn't work. It gives error
@carsonwardell551
@carsonwardell551 10 ай бұрын
12:08 where is the documentation for passing objects?
@Romahotmetytky
@Romahotmetytky Жыл бұрын
And how are you going to UnitTest the Tap(string s) method huh ? you are using Static Shell class there for me that is a code smell, and now you cannot use user view model by different framework e.g wpf or winui cause you are depending on Shell
@strictnonconformist7369
@strictnonconformist7369 Жыл бұрын
This is a beginner's set of lessons. Myself, I'd pass in a reference via the constructor to an interface that does what is needed so it's not so tied to the framework details.
@kabeernarang3936
@kabeernarang3936 Жыл бұрын
Can you give me 100x200 size modal page example with progress bar and close button
@ernesteiradukundasenga92
@ernesteiradukundasenga92 Жыл бұрын
When I try to add another item after deleting the previous one the program crushes immediately.
@tasoscat4295
@tasoscat4295 4 ай бұрын
my GoBack button is not working. Any suggestions?
@DivanProdOfficial
@DivanProdOfficial Жыл бұрын
How is this for beginners? I wonder how is the advanced part
@JamesMontemagno
@JamesMontemagno Жыл бұрын
If you are looking for more of an overview intro checkout kzbin.info/www/bejne/qKbQl3ydbtZ9lbs
@bohodirjonmirzayev2553
@bohodirjonmirzayev2553 Жыл бұрын
Swipe is not works on Windows, how can i solve it?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
On windows they work if you are on a touch screen else there is a new context menu: devblogs.microsoft.com/dotnet/5-dotnet-maui-desktop-features/#context-menus
4 ай бұрын
Oh, most boring MVVM code lines in setters OnPropertyChanged will be gone? Next thing will be .ConfigureAwait(false)?
@Vitorgasparete
@Vitorgasparete Жыл бұрын
Why the GoBack Command needs to be async?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
Navigation is asynchronous that is why. Just a best practice
@creativemoreafrica3020
@creativemoreafrica3020 Жыл бұрын
Hi James, Hi like all your videos but i have question. It possible to pass the object in QueryProperty ? How to do it ?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
Absolutely - learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/navigation?view=net-maui-7.0#pass-data
@EdRawrDev5813
@EdRawrDev5813 Жыл бұрын
will NavigationPage.HasNavigationBar="true" still working like default nav back?
@JamesMontemagno
@JamesMontemagno Жыл бұрын
Yes should
@selfreliantfarmer
@selfreliantfarmer Жыл бұрын
Does anyone know how to add a login page to this solution?
@HackelSchorsch
@HackelSchorsch Жыл бұрын
The music in the background is really unnecessary and annoing. I want to concentrate on MAUI stuff.
@light-water
@light-water Жыл бұрын
The music was a little distracting
@olayemiafolabi6091
@olayemiafolabi6091 2 жыл бұрын
I need MAUI code to get android or ios device id
@SuchithM
@SuchithM Жыл бұрын
Any example for content page navigation
@JamesMontemagno
@JamesMontemagno Жыл бұрын
Shell navigation: learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/navigation?view=net-maui-7.0 or NavigationPage style: learn.microsoft.com/en-us/dotnet/maui/user-interface/pages/navigationpage?view=net-maui-7.0
@SuchithM
@SuchithM Жыл бұрын
@@JamesMontemagno thank you 😊
@jmpeax3596
@jmpeax3596 6 ай бұрын
The never-changing "music" gets very annoying very quickly!
@zoliking
@zoliking Жыл бұрын
"for Beginners", lol. I don't think so.
@JamesMontemagno
@JamesMontemagno Жыл бұрын
If you are looking for more of an overview intro checkout kzbin.info/www/bejne/qKbQl3ydbtZ9lbs
@zoliking
@zoliking Жыл бұрын
@@JamesMontemagno Thank you.
@jawadhasaneducation
@jawadhasaneducation 6 ай бұрын
background music is distracting and un-necessary in my opinion
@neofox2526
@neofox2526 Жыл бұрын
goofy fall guys music 💀💀
@rds9799
@rds9799 3 ай бұрын
nihuya ne ponyatno bro. govori na russkom
@SerenityMusicOasis
@SerenityMusicOasis 2 ай бұрын
Wow, all that work to go to another page?????? 4 years to develop a 20 pages app?! 🤣
What is the MVVM pattern, What benefits does MVVM have?
22:38
James Montemagno
Рет қаралды 96 М.
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 18 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 38 МЛН
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 36 МЛН
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 141 М.
.NET MAUI's Navigation for Beginners - Push, Pop, & Pass Objects
21:36
James Montemagno
Рет қаралды 65 М.
Dependency Injection with .NET MAUI Explained! Full Beginner's Guide
19:18
Starting .NET MAUI Development in 2024 - What You Need To Know
35:18
James Montemagno
Рет қаралды 63 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 352 М.
The Giant sleep in the town 👹🛏️🏡
00:24
Construction Site
Рет қаралды 18 МЛН