canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
MIT License
994 stars 143 forks source link

Added an introductory example #171

Closed ShuhuaGao closed 3 years ago

ShuhuaGao commented 3 years ago

Hi,

I am new to MVVM in WPF. After playing with several frameworks like MVVMCross and ReactiveUI, I feel that Stylet is the most straightforward and easy-to-use one since it does not involve a lot of magic. Thank you.

I want to make some contribution and thus write an introductory example from a beginner's perspective, which I believe is quite friendly to complete beginners. The tutorial is posted to the Wiki here. However, I don't know how to add a link to it in the sidebar. Could you make it? I will keep improving the tutorial.

sigmarsson commented 3 years ago

You can utilize the Fody injector to have all your properties notified by its weaver. @canton7 was exhibiting it in a demo earlier so you can watch how he accomplished that.

ShuhuaGao commented 3 years ago

Hi, @sigmarsson , yes, you are totally right. I am aware of Fody. However, I am aiming to prepare a tutorial for a beginner of WPF/MVVM (like myself a week ago), and thus I avoid Fody intentionally to reduce the magic behind. I may add it in the advanced part.

canton7 commented 3 years ago

Thanks for putting in that effort! How does this relate to the pre-existing tutorial at https://github.com/canton7/Stylet/wiki/1.-Introduction (which I don't think I ever got around to finishing, sadly)?

ShuhuaGao commented 3 years ago

Hi, @canton7. Personally, I think that the tutorial I prepared is more detailed (almost every line is explained), beginner-friendly (I also explain some operations in Visual Studio), and up-to-date. You may keep both if needed.

Besides, as for the Samples in this repository, I cannot make them run in my Visual Studio 2019. For example, starting the Stylet.Samples.Hello project results in errors: Snipaste_2020-11-21_21-06-08

It seems some configuration changes are needed, but I am not clear how to do it.

canton7 commented 3 years ago

Sorry for not responding -- this slipped under my radar.

Is there somewhere else you could host this, where I could link to?

The problem with making it part of the wiki is that it then becomes my responsibility. This means I need to vouch for its correctness, and also update it when changes are made.

ShuhuaGao commented 3 years ago

Hi, @canton7. I am afraid that the example is a little outdated w.r.t the current version of Stylet. No need to maintain it now. Please feel free to remove it from your wiki (I don't know how to do it though).