OH MY GOODNESS!!! Visual Studio 2019 version 16.9 introduced one of the most amazing features ever... Auto code generation directly from your XAML! Turn your Bindings and Commands directly into source code in your code behind or view model! Today I will show you this awesome new feature!

If you are using Xamarin.Forms you can set the x:DataType or the BindingContext. If you are using WPF/UWP set the DataContext or d:DataContext. Read more: https://montemagno.com/code-generation-from-xaml-in-visual-studio/

This feature is currently only on Visual Studio 2019 v16.9 on Windows and not Visual Studio for Mac yet.

Time Codes:
00:00 - Intro
02:05 - Setup & Auto Generate Bindings
05:00 - Generate Commands
05:50 - Cleaner Generation with BaseViewModel
07:00 - Wrap-up

 

#visual-studio #xaml 

Qickly Tips: Code Generation from XAML in Visual Studio 2019! (WPF, UWP, & Xamarin.Forms)
5.35 GEEK