Code-Behind or MVVM #1868
-
Hi ! Thanks in advance if someone responds ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
In my opinion, the right architecture depends on your app’s complexity and how much data flows through it.
Note It’s not just a choice between code-behind and MVVM. There are other valid approaches. For example, the WinUI Gallery app doesn’t strictly use either. So the real question isn’t "Should I use MVVM or not?" |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your response. |
Beta Was this translation helpful? Give feedback.
-
Usually, I implement my apps using MVVM. However, this doesn't mean that there won't be any code-behind. My approach is to separate the projects. For example: ToDo (WinUI 3 Project)Views, all UI-related components or anything requiring the ToDo.Core (C# Class Library Project)ViewModels, Models and other core logics belong here. |
Beta Was this translation helpful? Give feedback.
In my opinion, the right architecture depends on your app’s complexity and how much data flows through it.
Note
It’s not just a choice between code-behind and MVVM. There are other valid approaches. For example, the WinUI Gallery app doesn’t strictly use either.
Instead, it follows a structure that organizes code by responsibility (e.g.,
Helpers
,Pages
,Samples
,Controls
etc.).So …