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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:24:08+00:00 2026-06-16T04:24:08+00:00

I have read up about this problem I am having and I cannot seem

  • 0

I have read up about this problem I am having and I cannot seem to find a solution for it. Some people have recommended to use the dispatcher to push the code execution onto the UI Thread. However this does not solve my issue. I am calling this code out of an Asyc method which is before hand called by a Guide object to display a notification. The code which controls the UI stuff is as follows:

public bool isDisabled
{
    set
    {
        if (value)
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    color = new SolidColorBrush(Colors.Gray);
                });
            enabled = false;
        }
        else
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    color = origionalColor;
                });
            enabled = true;
        }
    }
}

and it is being called from

    private void nameInputFinished(IAsyncResult ar)
    {
        int? result = Guide.EndShowMessageBox(ar);

        if (result == 0)
        {
             [...]

             JourneyPanels.getPanel(JourneyPanelTypes.integration).isDisabled = false;
        }
    }

Not sure why I am getting the corss-thread exception but I am pretty sure it has something to do with the async method nesting.

Any help is greatly appreciated!

EDIT: Full Exception Stack

  {System.UnauthorizedAccessException: Invalid cross-thread access.
  at MS.Internal.XcpImports.CheckThread()
  at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, Boolean b)
  at System.Windows.DependencyObject.SetValue(DependencyProperty property, Boolean b)
  at System.Windows.Controls.TextBox.set_IsReadOnly(Boolean value)
  at PocketRitual.Journey.nameInputFinished(IAsyncResult ar)
  at Microsoft.Xna.Framework.GamerServices.ActionDialogHelper.Complete()
  at Microsoft.Xna.Framework.GamerServices.ActionDialogHelper.GetMessageBoxResult(Object state)
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
  at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
  at System.Threading.ThreadPoolWorkQueue.Dispatch()
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()}
  • 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-06-16T04:24:09+00:00Added an answer on June 16, 2026 at 4:24 am

    It’s your calling code you need to run on the main UI thread e.g.

    Deployment.Current.Dispatcher.BeginInvoke(() => {
        JourneyPanels.getPanel(JourneyPanelTypes.integration).isDisabled = false;
    });
    

    There is no need to call Dispatcher on your internal property changes because you will be running on the UI thread at that point.

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

Sidebar

Related Questions

I have read all threads about this without finding any answer to my problem.
I have read some posts about this topic and the answers are comet, reverse
This is the dumbest little problem I am having and I CANNOT find the
I have read a lot about this issue but mine still seems to be
I have read this article about 400% boost of your website . This is
I have read this article from High Scalability about Stack Overflow and other large
Read about the issue in this stackoverflow question . Still have the same issue
I have been trying to read as much on stackoverflow about this as possible,
I've read through the various posts on SO about this, but have still not
I've read this book section about git branches. I have create a branch called

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.