Better MVVM with MVVM Helpers

  Рет қаралды 45,717

James Montemagno

James Montemagno

Күн бұрын

Let's take our MVVM to the next level with some great helper libraries that can be used in any application including Xamarin, Xamarin.Forms, WPF, UWP, and more! With MVVM Helpers you are able to easily get access to property change notifications, base viewmodels, helpers utilities, and optimizations around observable collections.
Full Xamarin Beginner's Playlist - • Xamarin & Xamarin.Form...
👕 Buy some swag! - jamesmontemagno.myspreadshop....
Time Codes:
00:00 - Introduction
01:30 - MVVM Helpers - What & Install NuGet
05:00 - Upgrading with ObservableObject & BaseViewModel
10:30 - AsyncCommand
12:00 - ObservableRangeCollection
17:00 - Xamarin Community Toolkit
Links:
* MVVM Helpers: github.com/jamesmontemagno/mv...
* Xamarin Community Toolkit: docs.microsoft.com/xamarin/co...
* Xamarin 101 - • Xamarin & Xamarin.Form...
* Source Code: github.com/jamesmontemagno/my...
What is on my hat? It is the CLE clothing logo because I am from Cleveland! Checkout their awesome CLE merch: cleclothingco.myshopify.com/
What is that art on my wall? It is an original piece from the French street artist Gregos of La Butte Montmartre: / bcez1onhiqx
Disclaimer: This channel, videos, and streams are created in my spare time and are a product of me... James Montemagno! They are NOT officially affiliated or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.
Follow:
👨‍💻 GitHub: github.com/jamesmontemagno
🦜 Twitter: / jamesmontemagno
🔴 Twitch: / jamesmontemagno
📄 Website: www.montemagno.com
📰 Newsletter: newsletter.montemagno.com/
My Setup:
* Blue Spark Microphone - amzn.to/3qgtYkq
* Blue Pop Filter - amzn.to/3jEWM3r
* Rode Microphone Arm - amzn.to/2Z68AlE
* Sony MDR7306 Headphones - amzn.to/372jxta
* Stream Deck - amzn.to/373Uk1n
* Elgato Cam Link - amzn.to/3a9eGbh
* GoPro Hero - amzn.to/374lm90
* MX Master 2S Mouse - amzn.to/3d7J2gj
* Tecware Phantom Keyboard - amzn.to/3aUP4y9
#XamarinForms #MVVM #iOS #Android #UWP

Пікірлер: 82
@maheshkumbhar4216
@maheshkumbhar4216 3 жыл бұрын
Thank you James. Got clear understanding on benefits of MVVM Helper / Xamarin Community Toolkit and Agreed on Less Code but Quality Code.
@efexzium
@efexzium 3 жыл бұрын
Thanks, James Montemagno Great contribution, at first it seemed a bit intimidating but now I understand and it works like a charm.
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
That is great to hear! :)
@richardsuarez1698
@richardsuarez1698 3 жыл бұрын
Thanks James, you provide so much value to the Xamarin community!
@willw2950
@willw2950 3 жыл бұрын
These videos have been amazing James! I have been trying to get my hands on any material that could further my knowledge on the Xamarin framework and many of the videos I found are often outdated and/or the lessons hard to follow. Your content has been by far the best I have seen. It has helped me better understand the core concepts of this platform as well as shown me handy tools to help streamline the app design process. Thank you very much for putting these tutorials out there!
@buddysnackit1758
@buddysnackit1758 2 жыл бұрын
agreed - I've had so much frustration dealing with bad examples etc that I actually feel good after watching this....it's so refreshing!
@trevorkobilo2480
@trevorkobilo2480 3 жыл бұрын
Thank you for the wonderful overview.
@seung-hunpark8167
@seung-hunpark8167 3 жыл бұрын
This is awesome lecture! Thanks a lot, James~~!!!
@mattbristo6933
@mattbristo6933 10 ай бұрын
Thanks James for these videos. They are really helpful.
@JamesMontemagno
@JamesMontemagno 9 ай бұрын
Very welcome
@mohamedabofanas
@mohamedabofanas 3 жыл бұрын
Nice one I'll give it a try. thanks for this video
@user-sy5fv3yl2s
@user-sy5fv3yl2s Жыл бұрын
Thank you so much for your contribution! ObservableRangeCollection is just what I need after trying on so many solutions found online to make AddRange possible
@chuckh9857
@chuckh9857 2 жыл бұрын
You are brilliant! Thanks for the help.🍻
@rakeshjha6545
@rakeshjha6545 2 жыл бұрын
amazing session James! I
@jayveebelano9041
@jayveebelano9041 2 жыл бұрын
you're great man nice vids keep on doing informative vids
@kafilahmed3666
@kafilahmed3666 2 жыл бұрын
Great effort!
@ahmadarab1066
@ahmadarab1066 3 жыл бұрын
Thank you very much, You are the best
@rolandvonkriegenbergh8540
@rolandvonkriegenbergh8540 2 жыл бұрын
You are awesome! 😎👍
@marianbalauru
@marianbalauru 3 жыл бұрын
Best class!!!
@mateuszwojtaszek9272
@mateuszwojtaszek9272 2 жыл бұрын
Hi I love your videos! Is there any chance you could make a detailed series about creating mvvm app (preferably WPF) using MVVM from Windows Community Toolkit? There arent any on the internet and WCT seems like is going to be a big thing. You could also focus even more on Source Generators I love your recent videos. Keep up the good work!
@philitsme3161
@philitsme3161 3 жыл бұрын
love ur video keep doing it
@redsoxfred
@redsoxfred 3 жыл бұрын
this is effing great
@ElCidPhysics90
@ElCidPhysics90 10 ай бұрын
I like the mvvmhelper. Using prism for WPF but seems like maybe it’s overkill for what I’m doing rn.
@varadareddy8645
@varadareddy8645 3 жыл бұрын
Hi, Thanks! how to make my scanner scan the barcode to the selected entry in MVVM
@charlesemge3824
@charlesemge3824 2 жыл бұрын
These are Great JM! Cant wait to finish this series. I am sure you are getting to this - Does the MVVM handle "Global Variables" ? Im struggling to find which class or page to place something like this in?
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
I mean you can access global static variables, but you shouldn't really use them IMHO. Would need some code sample of what you are trying to do.
@Jad.abouzaki
@Jad.abouzaki 2 жыл бұрын
Thank you soo much , I have one question that the ObservableRangeCollection
@greeksinmars
@greeksinmars 2 жыл бұрын
Hey james . how Refreshing previous content page Xamarin Forms with mvvm ? I have an object in some page and when open edit page (pass the object as parameter) and then editing and save and go to the back Object page (previous page) but i don't show the changes.....Is this possible with some mvvm approach ?
@sawood2010
@sawood2010 2 жыл бұрын
will services still work on WPF, UWP provided that they are implementing an interface?
@poorneshv7532
@poorneshv7532 3 жыл бұрын
@James Montemagno : Some videos on Mvvm Lite please.
@saroshwadia
@saroshwadia 3 жыл бұрын
Awesome Video as usual :-) Clean, to the point and easy to understand. Great Job. Have a question, How can I keep my POCO classes clean but still use INotifyPropertyChanged? Don't really want to duplicate the POCO classes. Thx
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
You can inherit from ObservableObject and will be good to go :)
@aeisopc7841
@aeisopc7841 2 жыл бұрын
@KenRossPhotography
@KenRossPhotography 3 жыл бұрын
Cool library James! If you're already pulling in the Community Toolkit, is it possible to pull in the MVVM Helper NUGET as well or is that just not necessary in your view given the XCT has "most" of the MVVM toolkit included.
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
I think XCT has everything you need from my library. That was the goal :)
@guyincognito1985
@guyincognito1985 3 жыл бұрын
MVVMHelpers: Over 1 million (ob)served!
@NightKingMarhoom
@NightKingMarhoom 3 жыл бұрын
You r great
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
You
@randyblock8747
@randyblock8747 2 жыл бұрын
Thankyou for your contribution. I was wondering if you have or can direct me to an Mvvm helper library that can assist in navigation in a Wpf mvvm application? I find this very challenging, especially when it’s not such a simple UI such as button clicks, but may involve dialog boxes, or cascading views.
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Have you looked at Prism? prismlibrary.com/docs/wpf/introduction.html
@knightfallgame
@knightfallgame 2 жыл бұрын
hello, do you have a video on how i would take an enum i made as a module and implimenting it into a form as a dropdown selectable table?
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
I can add that to my list for sure, but look at docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/picker
@knightfallgame
@knightfallgame 2 жыл бұрын
@@JamesMontemagno that would be amazing, wow thank you for responding so quickly, ill give the docs a read
@khaledbudajaja6137
@khaledbudajaja6137 3 жыл бұрын
Awesome James, Does MVVM Helpers support displaying dialogue from viewmodel?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
MVVM Helpers doesn't know anything about UI frameworks so nothing special there.
@khaledbudajaja6137
@khaledbudajaja6137 3 жыл бұрын
@@JamesMontemagno What do you recommend to open window from viewmodel?
@sergiuungureanu1085
@sergiuungureanu1085 3 жыл бұрын
So, why not using Xamarin.Forms? is to reduce the libs size? or else? I did't get that point completely, could you elaborate? Thank you.
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
We are totally using Xamarin.Forms in this sample :) MVVM Helpers has some nice things to help out with data binding and works in any application. Now, if you are doing Xamarin.Forms then you can install Xamarin Community Toolkit, which I donated most of the code from MVVM Helpers, just depends on your app and if you are using other stuff from XCT.
@teriyakov
@teriyakov 3 жыл бұрын
Why the need for IsBusy and IsNotBusy (both booleans) in the baseviewmodel?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
I use them based on if I want to show something when loading and when not loading. This way I don’t need a converter
@stephanw8279
@stephanw8279 3 жыл бұрын
Will the Grouping class also be brought the XCT?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
That is a great question, it is super minimal code you could just grab. I’ll inquire with them.
@rakeshravig
@rakeshravig 3 жыл бұрын
I am searching for a good tutorial about ListView in MVVM. Facing issues with ItemTapped, ItemDisappearing events. Can you please make a tutorial at least these two events?
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
It is on my list for sure! Next video probably actually :)
@rakeshravig
@rakeshravig 3 жыл бұрын
@@JamesMontemagno Thanks, bro.
@tasher7882
@tasher7882 2 жыл бұрын
James, what is the transition to Maui for this library?
@JamesMontemagno
@JamesMontemagno 2 жыл бұрын
Can be used as is.
@maxalmonte14
@maxalmonte14 2 жыл бұрын
My only question: is that a GameBoy Micro or a Game and Watch?
@belmiris1371
@belmiris1371 3 жыл бұрын
I had to give up on most MVVM architecture, it was just too complex and messy. I find I can write much cleaner apps with much simpler logic by just keeping the UI logic in the code behind. Behaviors, triggers and all the ICommand stuff was just making a class explosion and making it hard for me to make changes to my application because I kept losing track of what was going on. The Xaml itself is already very messy with the tags everywhere, I wish there was a Winforms option. I like to keep the business logic in my view model and the UI in the UI. I still use databinding but even so I do a final check when the user presses the update button and make sure what is on the screen is what's in my view model, the framework has just let me down too many times.
@JamesMontemagno
@JamesMontemagno 3 жыл бұрын
Take a look at devblogs.microsoft.com/xamarin/c-sharp-markup-for-xamarin-forms/ which is now part of the xamarin community toolkit
@marciomaciel1671
@marciomaciel1671 3 жыл бұрын
"Problems" with Code-Behind: * it is much easier to use unit tests in ViewModel than in events; * if you change the visual component in the UI you may have to make changes to the Code-Behind, in the ViewModel the code remains the same regardless of the visual component in the UI; * maintaining dozens of events is much more work than just treating things logically, like "IsBusy"; * and finally we have the update "Enable = True/False" which is automatic from MVVM when we use Command and CanExecute, if we do it with Code-Behind it is our task to update the button states and etc. If you miss WinForms/Events when dealing with XAML/Command then it is possible that the paradigm was presented to you in the wrong way. I guarantee, after mastering the concept and visualizing all the less effort that is programming in MVVM, there is no return to the old VB6 style.
@belmiris1371
@belmiris1371 3 жыл бұрын
@@marciomaciel1671 I use viewmodels for business logic and so unit testing is the same. I even use databinding with the INotifyPropertyChanged event. Even if I didn't and set my properties when the user hit an update button it wouldn't affect testing. My issue is with the UI and all the classes xaml needs to do things that are very simple to do in the code behind like knowing if a field has been entered and changed by the user as opposed to being populated by the application so I can show an error only after the user has entered the field. xaml in xamarin does not even allow access to what property a view control is bound to or the name of a view control. And triggers, behaviors and converters had me looking in a whole bunch of files and opened up memory leak issues with their use of event listeners. It made debugging a nightmare. Mostly though it was just so complex that I could not follow what my page was doing and I was getting nothing back for all the headaches. So, I do all my UI in the code behind, one file, and my logic in my viewmodel.
@greggseipp
@greggseipp Жыл бұрын
@@belmiris1371 This. I think it's cool that you can do all this event handling in XAML but, when things get complex, untying your hands to use code-behind can clear up things in a hurry. It's really a matter of where you draw the line between the view and the viewmodel and how you define them. The rule to say that the view has to be written entirely in XAML is artificial. *That's* the conversation we need to have. Eliminating code-behind is a nice goal but, in my mind, it muddies the MVVM waters.
@microtech2448
@microtech2448 10 ай бұрын
Instead of AsyncCommand please make it CommandAsync() ?
@DavidFuchs
@DavidFuchs Жыл бұрын
Why are we using your library as opposed to the actual library Xamarin.Forms .. other than your ego I mean.
@JamesMontemagno
@JamesMontemagno Жыл бұрын
As I described in the video it offers up a lot of nice things that aren’t in the box. In newer videos as I talk about I use mostly the .NET Community Toolkit for MVVM
@DavidFuchs
@DavidFuchs Жыл бұрын
@@JamesMontemagno I went through the Library last night and like it. I wasn't expecting a beginners course to have this thrown in at the beginning, it might have been better to have added this towards the end and stuck with the basics.
@jibspangs4314
@jibspangs4314 3 жыл бұрын
Thanks, James You are really good in Teaching, most off all you really feel what we need
@jibspangs4314
@jibspangs4314 3 жыл бұрын
hello sir James, since i'm new in your chanel, can't follow along, while playing this video Can't find Coffee.cs in my project
Xamarin.Forms ListView - Everything you need to know (& .NET MAUI)
36:49
James Montemagno
Рет қаралды 62 М.
What is the MVVM pattern, What benefits does MVVM have?
22:38
James Montemagno
Рет қаралды 95 М.
ЧУТЬ НЕ УТОНУЛ #shorts
00:27
Паша Осадчий
Рет қаралды 10 МЛН
I'm Excited To see If Kelly Can Meet This Challenge!
00:16
Mini Katana
Рет қаралды 30 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 22 МЛН
Amazing weight loss transformation !! 😱😱
00:24
Tibo InShape
Рет қаралды 67 МЛН
How much does the Windows Community MVVM Toolkit REALLY help us?
7:02
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,5 МЛН
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 129 М.
Preparing a Xamarin.Forms Shell App for Development
11:28
James Montemagno
Рет қаралды 33 М.
How AI could help us talk to animals
9:06
Vox
Рет қаралды 509 М.
XAML Data Binding and MVVM Basics (.NET MAUI, WPF, UWP, Xamarin.Forms)
19:15
The Logging Everyone Should Be Using in .NET
15:34
Nick Chapsas
Рет қаралды 52 М.
Dependency Injection with .NET MAUI Explained! Full Beginner's Guide
19:18
Dynamic App Themes in Xamarin.Forms - Light, Dark, & Custom Modes
25:13
James Montemagno
Рет қаралды 19 М.
low battery 🪫
0:10
dednahype
Рет қаралды 1,8 МЛН
Сколько реально стоит ПК Величайшего?
0:37
ноутбуки от 7.900 в тг laptopshoptop
0:14
Ноутбуковая лавка
Рет қаралды 3,6 МЛН
Better Than Smart Phones☠️🤯 | #trollface
0:11
Not Sanu Moments
Рет қаралды 19 МЛН
#samsung #retrophone #nostalgia #x100
0:14
mobijunk
Рет қаралды 14 МЛН