Relative Content

Tag Archive for c#mvvm

Optimizing Autosave Mechanism for Nested Forms with Multiple Property Changes?

I want to implement an autosave mechanism for my form, which consists of a hierarchy of subforms, each containing further subforms. The goal is to trigger an autosave whenever any property changes at any level within the form. I’ve included a pseudo-code for the class structure, showing how events would propagate from the deepest level up to the top to initiate the save. However, I’m concerned about the potential overhead of handling so many property changes. Is there a more efficient approach or any improvements I could make?
(This is an example code, in my real code i have way more properties and more lists with nested forms).

Does the MVVM pattern assume binding updates are always synchronous?

This question is not specific to any one UI platform, but suppose in a WPF-like UI I have 3 RadioButtons each two-way bound to separate view model properties – bool Value1, bool Value2, and bool Value3 – and grouped under a common group name so that the UI enforces a mutually exclusive relationship. Suppose that Value1 is true by default.