Reader small image

You're reading from  The MVVM Pattern in .NET MAUI

Product typeBook
Published inNov 2023
Reading LevelBeginner
PublisherPackt
ISBN-139781805125006
Edition1st Edition
Languages
Right arrow
Author (1)
Pieter Nijs
Pieter Nijs
author image
Pieter Nijs

Pieter Nijs is a .NET consultant at Xebia in Belgium, with a keen interest in mobile and cloud development. He's been instrumental in diverse projects, from vast healthcare and telecom systems to compact LOB apps. Now, Pieter's exploring AI's potential to enhance customer projects innovatively. Passionate about technology, he actively experiments and shares knowledge as a conference speaker and trainer. Pieter has been awarded the Microsoft MVP Award since 2017, reflecting his unwavering passion and expertise in serving the community.
Read more about Pieter Nijs

Right arrow

Common misconceptions about MVVM

There are several common misconceptions about MVVM that can lead to misunderstandings of its principles and best practices. Let’s dispel some of these and provide clarity on the pattern.

There should be no code in the code-behind

While it is true that the main purpose of MVVM is to separate the presentation logic from the application logic, it is not necessarily the case that there should be no code in the code-behind. The code-behind can still be used to handle simple UI-related events or for any logic that is tightly coupled with the View.

In fact, there are scenarios where putting some code in the code-behind can be more efficient and maintainable than trying to move everything to the ViewModel. For example, handling UI animations, scrolling, and controlling focus or complex visual behaviors may be easier to implement in the code-behind rather than trying to do it through data binding.

To ensure proper separation of concerns in...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The MVVM Pattern in .NET MAUI
Published in: Nov 2023Publisher: PacktISBN-13: 9781805125006

Author (1)

author image
Pieter Nijs

Pieter Nijs is a .NET consultant at Xebia in Belgium, with a keen interest in mobile and cloud development. He's been instrumental in diverse projects, from vast healthcare and telecom systems to compact LOB apps. Now, Pieter's exploring AI's potential to enhance customer projects innovatively. Passionate about technology, he actively experiments and shares knowledge as a conference speaker and trainer. Pieter has been awarded the Microsoft MVP Award since 2017, reflecting his unwavering passion and expertise in serving the community.
Read more about Pieter Nijs