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 7010179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:57:29+00:00 2026-05-27T21:57:29+00:00

I am making a Todo Type of application where a user can make a

  • 0

I am making a Todo Type of application where a user can make a note and constantly move the note around the screen. On every change of position of “note” I need to save it into database:

The typical code for this is:

 private void SaveChanges()
    {
        if (!_context.IsSubmitting)
        {
            this.busyIndicator.IsBusy = true;
            _context.SubmitChanges(subOp =>
            {

                this.busyIndicator.IsBusy = false;
                if (subOp.Error != null)
                {
                    ErrorWindow window = new ErrorWindow(subOp.Error.Message);
                    window.Show();
                }

            }, null);
        }
    }

However as you can see I am blocking the UI by using busyindicator and stopping the user to do any activity while it is submitting. This is bad especially for this application. So as an alternative I tried to move this code onto a different thread using this code:

    private void SaveChanges()
    {
        ThreadPool.QueueUserWorkItem(waitcall =>
        {
            if (!_context.IsSubmitting)
            {
                //this.busyIndicator.IsBusy = true;
                _context.SubmitChanges(subOp =>
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        //this.busyIndicator.IsBusy = false;
                        if (subOp.Error != null)
                        {
                            ErrorWindow window = new ErrorWindow(subOp.Error.Message);
                            window.Show();
                        }
                    });

                }, null);
            }

        });
    }

This works and the application still remains responsive. However now while the context is submitting the changes and the user works with the same note by moving it around the screen etc the binding try to change the entity’s properties and I get exception:

This entity is currently read-only

I understand this is obvious because the context is submitting the changes. However is there any way by which I can keep the application responsive by not showing the dumb busy indicator and still not get these exceptions?

  • 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-27T21:57:29+00:00Added an answer on May 27, 2026 at 9:57 pm

    During SubmitChanges, all changed properties are set to read only. In your case, it is the position properties. I am guessing that the properties are bound to the note position.

    Possiblities:

    1. Do not bind to the entity in your DomainContext. Bind to a client local object with property changed events (perhaps a clone of the entity). Use the property changed events to try to copy the change to the context entity. If it fails (read-only), you may want to add code to retry later.

    2. Use EntityGraph partial submit from RIA Services Contrib.
      riaservicescontrib.codeplex.com
      Check the discussions / blogs – code is provided to clone the EntityGraph into a temp context and submit the temp context. I do not think you will want to Synchronize on completion because that would probably overwrite the new position and cause the window to jump around. Just submit and forget.
      If you are adding the entity on the client and it needs auto generated key properties returned from the server (identity, etc.). Then, do not use a temp context / partial submit for the add. Block the UI and submit the add normally so your client properties are updated on completion and a partial submit is not called before your key values have been set.

    I would be interested in any other possible solutions.

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

Sidebar

Related Questions

I'm making a Cocoa application and I can't figure out how to do something.
I am making an application where the user is prompt at some point to
Making echo of a question around the web: Is the syntax for svn:ignore patterns
I am making a custom configuration in my winform application. (It will represent a
I am making an application that displays a picture of a room. When the
I have been making a little toy web application in C# along the lines
I am curious if there are any examples in making an embedded application that
I am learning the C# programming language and am making a payroll application add-on
I'm making an android application, where there is a view composed of hundreds of
Suppose you are making a GUI application, and you need to load/parse/calculate a bunch

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.