C
C#4mo ago
Gokul

Book/Documentation reference to get started with wpf

as the title says i need book recommendation or articles which will be helpful to get started with wpf. i have experience with dotnet webapi and i would like to learn a language which is helpful in developing desktop application. hence learning wpf
3 Replies
leowest
leowest4mo ago
This website shows u some of the basic and most used controls and how they are used, what they can do, and some more advanced controls as well as creating templates, so totally worth checking and going thru. https://wpf-tutorial.com/about-wpf/what-is-wpf/ and after u get a feel of the controls and more into WPF learn MVVM https://www.youtube.com/playlist?list=PLA8ZIAm2I03jSfo18F7Y65XusYzDusYu5 and once you understand INPC and MVVM, delve into MVVM Community Toolkit to extract away the boiler plate and reduce code. https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/ oh right and the most important part of it is $rulesofwpf
MODiX
MODiX4mo ago
Rules of WPF:

❌ Avoid the WPF Designer to eliminate a category of confusing bugs
❌ Don't rely on Margin as the primary tool for layouts
❌ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

✅ Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
✅ Rely upon XAML Hot Reload to design your app's UI at runtime
✅ Use layout controls (Grid, DockPanel, etc) to support proper resizing
✅ Use data binding to eliminate glue code and state synchronization issues
✅ Use collection controls and DataTemplate to dynamically create lists of controls
✅ Learn MVVM to create maintainable apps
✅ Use the Dispatcher to update controls from non-UI threads
✅ WPF's default controls can be easily modernized via $wpfuilibs
✅ Include relevant XAML, code-behind, and ViewModel code for questions when possible
Rules of WPF:

❌ Avoid the WPF Designer to eliminate a category of confusing bugs
❌ Don't rely on Margin as the primary tool for layouts
❌ Avoid writing UserControls or subclassing to extend a default control -- use Behaviors instead (Microsoft.Xaml.Behaviors.Wpf)

✅ Write XAML by hand and autoformat with "Ctrl K,D" or XAML Styler
✅ Rely upon XAML Hot Reload to design your app's UI at runtime
✅ Use layout controls (Grid, DockPanel, etc) to support proper resizing
✅ Use data binding to eliminate glue code and state synchronization issues
✅ Use collection controls and DataTemplate to dynamically create lists of controls
✅ Learn MVVM to create maintainable apps
✅ Use the Dispatcher to update controls from non-UI threads
✅ WPF's default controls can be easily modernized via $wpfuilibs
✅ Include relevant XAML, code-behind, and ViewModel code for questions when possible
leowest
leowest4mo ago
since it does not function like winform where u can drag and drop controls around be aware of these rules for an improved experience with it
Want results from more Discord servers?
Add your server