Тёмный

Prism - Using the ViewModelLocator 

Brian Lagunas
Подписаться 18 тыс.
Просмотров 21 тыс.
50% 1

In this video, I show you how to automatically create an instance of your ViewModel and assign the DataContext of your views to that instance by using the Prism ViewModelLocator.
Follow me on Twitter
/ brianlagunas
Please visit this video sponsor
bit.ly/prism-i...
Help support Prism and become a Patron
/ prismlibrary

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@3l3odor
@3l3odor 4 года назад
Short and clear, all that you need to be up and running ! Thank you !
@BrianLagunas
@BrianLagunas 4 года назад
Thanks for watching
@keyvankabirnia2609
@keyvankabirnia2609 4 года назад
I really love your tutorials and I know making them takes you lots of time, precious time, and I appreciate that. As many others do, I'm really looking forward to watch your new series of tutorials related to best practices. by the way I'm eager to know your own way of implementing splash-screen via wpf-prism that shows the progress of loading modules.
@BrianLagunas
@BrianLagunas 4 года назад
Thanks for watching
@moifouss
@moifouss 5 лет назад
Thanks !
@BrianLagunas
@BrianLagunas 5 лет назад
You're welcome
@EdonaManona
@EdonaManona 4 года назад
Brian, you have great videos, very informative... ...However... in your example the App inherits nothing so, 'App.CreateShell()': no suitable method found to override. This is what I've got ;(
@BrianLagunas
@BrianLagunas 4 года назад
You need to update your App.xaml to be a PrismApplication
@sergiotardo
@sergiotardo 4 года назад
Excelent very helpfull,.. only one question, how could I have intellicense in the XAML? when using AutowiredViewModel="True"
@BrianLagunas
@BrianLagunas 4 года назад
Have you tried using a design DataContext?
@sergiotardo
@sergiotardo 4 года назад
@@BrianLagunas mmm no, I really don't know how to do it, do you have a reference o sample of how to use design DataContext? thanks
@BrianLagunas
@BrianLagunas 4 года назад
@@sergiotardo No I don't, but your favorite search engine can help.
@GauravSharma-jq2hp
@GauravSharma-jq2hp 2 года назад
HI Brian, One question on this, When we have AutowireViewModel set to true, If we manually create an instance of ViewModel somewhere in application, does the corresponding View automatically binds to that instance also ?
@BrianLagunas
@BrianLagunas 2 года назад
No. If you manually create the VM you are responsible for assigning it to the view. The Autowire will still create another instance if it is set to true.
@erikjansen9149
@erikjansen9149 2 года назад
I Like your video's and did your PluralSightCourse. However I found that Prism does do ServiceLocators anymore(deprecated). I have a program that gathers data from DB and screen and then(on a Command) does a lot of tech calculations and outputs the results to a PDF or HTM. Where does that (large) part of the program go? The Model? the ViewModel? I thought a service would be logical.
@BrianLagunas
@BrianLagunas 2 года назад
Thank you for your support! It is greatly appreciated. Yes, using a service would be my suggestion, maybe more than one service. Hide all the implementation details behind services.
@hovermind
@hovermind 5 лет назад
Waiting for pluralsight course "Prism for Xamarin.Forms" (especially modular architecture)
@BrianLagunas
@BrianLagunas 5 лет назад
I'm not sure if I will do another Pluralsight course. I might, but they are not the same company they used to be. I'll have to really think about it.
@BrianLagunas
@BrianLagunas 3 года назад
Yeah, basically. They dramatically cut author royalties and the personal connection is no longer there. You no longer feel a part of the company, you're just a body to record content.
@BrianLagunas
@BrianLagunas 3 года назад
That is awesome. Let me know when you publish your first video. You'll do great.
@adrianstanev
@adrianstanev 4 года назад
HI Brian! Thank You very much for all tutorials. Very useful. While experimenting, I came across to something strange to me. If I put the View & ViewModel in the same folder (named somehow), the View finds the ViewModel and has the DataContext set. It works even if I remove ...View... and ...ViewModel... from the namespace. How is this happening?
@BrianLagunas
@BrianLagunas 4 года назад
Yes, this is actually by luck. If the ViewModelLocationProvider finds Views in the namespace, it will replace it with ViewModels in order to find the ViewModel for the view. However, in your case, both the View and VM are in the same folder not named Views, which essentially bypasses the logic that modifies the namespace when trying to find the VM. So yes, that will work. It's just not the recommended pattern.
@adrianstanev
@adrianstanev 4 года назад
@@BrianLagunas Thank you, Brian.
@DrLegitimate
@DrLegitimate 2 года назад
Holy cow dude, I really appreciate the time you take to make these videos, but it's 4 minutes until you hit anything that is relevant to the video title. Also, your website serving an ad I have to click out of to scroll is a huge dick move.
@BrianLagunas
@BrianLagunas 2 года назад
The first 4 minutes include the sponsor of the video, which this video wouldn't have been made without, and an explanation/walkthrough of the code before we modify it which is important to a lot of people. Luckily, you can just fast forward through the parts that aren't important to you. That ad that is shown on my website is for my Pluralsight course which helps support my OSS work, blog, videos, and other community contributions. Without it there would be no content from me. You want know what's a huge dick move? Wanting everything for free without having to contribute to anything that may actually support the content you want.
@rushaalmaksane7892
@rushaalmaksane7892 4 года назад
Thanks!
@BrianLagunas
@BrianLagunas 4 года назад
Thanks for watching
Далее
Prism for Xamarin.Forms - Navigation Basics
15:09
Просмотров 22 тыс.
НЮША УСПОКОИЛА КОТЯТ#cat
00:43
Просмотров 642 тыс.
Песня РАСПУТИН на русском!🔥
00:56
Prism - Using Delegate Commands
11:31
Просмотров 36 тыс.
WPF in C# with MVVM using Caliburn Micro
1:23:30
Просмотров 364 тыс.
Prism - Using the Event Aggregator
9:14
Просмотров 31 тыс.
Is LEARNING WPF still WORTH it in 2023?
10:59
Просмотров 52 тыс.
C# Yield Return: What is it and how does it work?
15:09
Prism - Using Composite Commands
10:36
Просмотров 14 тыс.
How are holograms possible? | Optics puzzles 5
46:24
Просмотров 136 тыс.
НЮША УСПОКОИЛА КОТЯТ#cat
00:43
Просмотров 642 тыс.