Тёмный

Mastering Sharing Data Between ViewModels in WPF Tutorial using MVVM 

Payload
Подписаться 21 тыс.
Просмотров 15 тыс.
50% 1

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

 

23 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@_buffer
@_buffer Год назад
Patreon: www.patreon.com/payloads Discord: discord.gg/kNFPKhvnYz
@windowsbuilderthegreat3121
@windowsbuilderthegreat3121 10 месяцев назад
You should do a video tutorial on AvaloniaUI, as it is a cross platform inspiration of WPF
@MultiLeechCZ
@MultiLeechCZ 6 месяцев назад
I would like to see how would you handle communication between viewmodels in avalonia? That would be great tutorial. Many ppl looking for it :D Thx
@giuseppepizzichemi5194
@giuseppepizzichemi5194 5 месяцев назад
If you want to pass data from the current model to a different view, such as a modal dialog, Avalonia/ReactiveUI: Interactions is the easiest way. If you want to share data between models, a View Model Service Locator (DI or IOC) is the fastest way from "writing the code" perspective. Observers are another valid resource but..as long as you feel like committing suicide 🙂
@izabellagerman
@izabellagerman 8 месяцев назад
Thanks. I like your videos
@_buffer
@_buffer 7 месяцев назад
You're most welcome! And thank you, that means a lot! :-)
@anesdiaf
@anesdiaf Год назад
Nice vid, can you do a video about "how we can detect changes in a collection's items and notify the ui".
@_buffer
@_buffer Год назад
Thank you! I have a video called "WPF INotifyPropertyChanged and Databinding" check that one out :D
@tum6300
@tum6300 11 месяцев назад
Are you actually using the ViewModelLocator? Can’t figure out where if yes…
@ShiruHDani
@ShiruHDani 2 месяца назад
2:57 he creates a property for each view model 6:17 he maps the windows to the view models 9:30 you can see the needed window manager 14:07 he calls the window manager method .ShowWindow() with the view model property from the locator as the parameter
@Andrei-qi4tm
@Andrei-qi4tm Год назад
your tutorials are very practical i wish you post more often but maybe you don't have time
@_buffer
@_buffer Год назад
Thank you! More oincoming! :-)
@peterbishop8065
@peterbishop8065 5 месяцев назад
This is probably a dumb question, but what does the (???) do in the Command ("Binding Path = (???).AddItemCommand") and ItemsSource ("{Binding Path = (???).ItemsService.Items}" ? I can't get it to run because of this. It seems like a placeholder for a DataContext, but I don't see where this DataContext is defined.
@peter2292
@peter2292 4 месяца назад
The author is using Jetbrains Rider as IDE, and this text, i.e. the 'Path = (???)'-part, comes from the Rider IntelliSense, and actually it's just a suggestion. There should be nothing there. Rider just says "maybe you want to put something here (like DataContext)". So, the author is actually using Command="{Binding AddItemCommand}" but IntelliSense in Rider puts a suggestion, which confuses for those of us who are not used to Rider, that says "hey, maybe you want to put Path=DataContext.AddItemCommand instead of just AddItemCommand" and so on.
@peterbishop8065
@peterbishop8065 4 месяца назад
@@peter2292 Thanks for the clear and thoughtful response Peter!
@Zer0bytte
@Zer0bytte Год назад
maximum video quality is 360!?
@_buffer
@_buffer Год назад
It's currently processing 4K, you were just too fast :D
@skylexwot
@skylexwot Год назад
360p max@@_buffer
@_buffer
@_buffer Год назад
@@skylexwot Yeah, it'll be another hour or so until it's done processing, RU-vid is being really slow processing 4K footage right now for some reason, hang in there :-)
@Zer0bytte
@Zer0bytte Год назад
@@_bufferbest one at wpf ♥️
@_buffer
@_buffer Год назад
@skylexwot @Zer0bytte should be all good now! :-)
@ivandrofly
@ivandrofly 11 месяцев назад
Thank you :)
@onyekaidika355
@onyekaidika355 Год назад
Finally. love your videos
@_buffer
@_buffer Год назад
That was quick lol
@axelminet1095
@axelminet1095 11 месяцев назад
Hello, how would you do if item is an ItemModel containing 2 properties, for example LastName and FirstName, and there is an ItemViewModel taking an itemModel as parameter and having a FullName property which comes from ItemModel.LastName and ItemModel.FirstName and an IsChecked property which is not in the model and is only used to check the items so that they can be deleted. Can ServicesItems return ItemViewMod3l viewmodels directly, is this a good way of doing things?
@hanneskasel1853
@hanneskasel1853 8 месяцев назад
Eh , yeah. Doing it like this you decoupled your Domain or Data Access Layer from the Presentation Layer, you could call it a frontend DTO smh. ``` public class ItemViewModel(ItemModel item ) : ViewModelBase { public string FullName => item.FirstName +" "+ item.LastName; public bool IsChecked { get; set; } = false; // default to false } ``` I 'd say you should lookup INotifyPropertyChanged and how to use it, or try out the Community.Toolkit.MVVM
@Jeremygrmn
@Jeremygrmn Год назад
Inspiraton from avalonia? You can easily do this same thing in wpf with datatemplates. The VM locator feels like a locator pattern in dependency injection 😬😬
@curtisnewton895
@curtisnewton895 6 месяцев назад
relay command ? any tutorial ?
@zakiisse7519
@zakiisse7519 Год назад
Love your videos man
@_buffer
@_buffer Год назад
Thanks! I really appreciate you and your comment!
@reonzar
@reonzar Год назад
It's been months !
@_buffer
@_buffer Год назад
It has! And we're back! :D
@reonzar
@reonzar Год назад
Let's goo !
@CloudCoderChap
@CloudCoderChap 8 месяцев назад
What’s the IDE you’re using here?
@AhmetYigiter
@AhmetYigiter 7 месяцев назад
JetBrains Rider
@kdowd161
@kdowd161 4 месяца назад
straightforward, it isn't. all that just to share data in the same App
@banepigeon
@banepigeon 8 месяцев назад
lol… I can’t get this code to work at alll
@_buffer
@_buffer 8 месяцев назад
What seems to be the issue?
@hanneskasel1853
@hanneskasel1853 8 месяцев назад
Where do you struggle?
@GbayTechnology
@GbayTechnology Месяц назад
a bad design
@emptybottle9262
@emptybottle9262 4 месяца назад
widnow
@curtisnewton895
@curtisnewton895 6 месяцев назад
why complicate everything, geee we dont need all that crap just to share data
@rattlehead999
@rattlehead999 3 месяца назад
What is a simpler way of sharing data between viewmodels?
Далее
How To Change Themes Using WPF Tutorial
11:30
Просмотров 4 тыс.
WPF C# Professional Modern Flat UI Tutorial
36:44
Просмотров 830 тыс.
That was too fast! 😲
01:00
Просмотров 4 млн
WPF INotifyPropertyChanged and Databinding
14:30
Просмотров 41 тыс.
Starting Your Unity Game Flawlessly (8 Steps)
9:51
Просмотров 12 тыс.
Is LEARNING WPF still WORTH it in 2023?
10:59
Просмотров 54 тыс.
C# WPF and GUI - Pages and Navigation
7:48
Просмотров 283 тыс.