Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6802931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:16:57+00:00 2026-05-26T19:16:57+00:00

This is more of a conceptual question. If it helps, lets say it falls

  • 0

This is more of a conceptual question. If it helps, lets say it falls into the MVVM pattern. I’ve never seen this addressed in any of my research into WPF Binding.

If you have a window where you have elements connected to view-model through binding and the user updates the record, but before saving decides to cancel the update, what would you consider the best method of reversing the changes would be?

I can think of a couple of possibilities:

  1. Instead of allowing the user to update the main display, have a second window pop up for editing that is bound to a copy of the VM and upon “Save”, writes that data into the original VM and then updates back to the model. Increases memory usage and complexity of the Save function.
  2. Make a “pristine” copy of the original VM object and, upon “Cancel”, write that VM back over the original (at which time the copy can be deleted). Increases memory usage and complexity of the Cancel function.
  3. Create a copy of each of the elements within the VM that might change upon creation and upon “Cancel”, write those values back over the changed ones. Increases the size and complexity of the VM.
  4. Upon executing “Cancel”, the VM hits the data source and reloads the record. Causes network traffic and DB access traffic and possibly lag time for display updating back to original state. Also might cause problems if the VM was updated from another process and these “external” updates should not be deleted.

Can anyone think of a better solution to this problem, or know of some obscure functionality within WPF that handles this “automatically”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:16:58+00:00Added an answer on May 26, 2026 at 7:16 pm

    I have implemented the IEditableObject on my ViewModels and I make a copy of the fields when entering Edit mode by invoking an EditCommand.

    I also have SaveCommands that can be called in when confirming the edit. Or use a CancelEdit command to revert to the copied values.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a conceptual question involving Hadoop/HDFS. Lets say you have a file containing
This is more of a conceptual question concerning the built in functionality of PHP
I have an interesting situation here this time. This more of a conceptual question,
this is more of a conceptual question. Is it aceptable/good programming mixing do/while loops
This is more of a conceptual question than anything. I have a base class
This is more a conceptual question. Here is my current predicament; I am writing
This is more of a conceptual question than an actual implementation and am hoping
EDIT : this question is very similar to this one but it's more conceptual
This is more like a conceptual question. When to use Model Binding (in ASP.NET
So this question is not so much technical but more sort of conceptual. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.