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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:54:25+00:00 2026-06-15T15:54:25+00:00

I am working with a Windows Phone Schedule Agent and I am trying to

  • 0

I am working with a Windows Phone Schedule Agent and I am trying to update the picture name after sync the problem is that I am getting an invalid cross exception when on this function at line “BitmapImage bmp = new BitmapImage();” and really don’t understand why.

void UpdateSyncPictureName(int AsyncStatus, int AticketID, int AsyncID, int ApictureID, int TsyncStatus = 0, int TsyncID = 0)
    {
        string filename = AsyncStatus + "-" + AticketID + "-" + AsyncID + "-" + ApictureID;
        using (IsolatedStorageFile ISF = IsolatedStorageFile.GetUserStoreForApplication())
        {
            if (ISF.FileExists(filename))
            {

                BitmapImage bmp = new BitmapImage();
                using (IsolatedStorageFileStream isoStream =
                    ISF.OpenFile(filename, System.IO.FileMode.Open))
                {
                    bmp.SetSource(isoStream);
                }
                ISF.DeleteFile(filename);
                WriteableBitmap Wbmp = new WriteableBitmap(bmp);
                using (IsolatedStorageFileStream isoStream =
                ISF.OpenFile(TsyncStatus + "-" + AticketID + "-" + TsyncID + "-" + ApictureID, System.IO.FileMode.Create))
                {
                    Extensions.SaveJpeg(Wbmp, isoStream,
                        Wbmp.PixelWidth,
                        Wbmp.PixelHeight,
                        0, 100);
                }


            }
        }
    }
  • 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-15T15:54:26+00:00Added an answer on June 15, 2026 at 3:54 pm

    The issue arises from the fact that BitmapImage cannot be instantiated outside of the UI thread. You can fix this issue by wrapping your calls in a Dispatcher Invoke call.

    However, you need to make sure that you call NotifyComplete correctly. As such you may need to put NotifyComplete in the Dispatcher call.

    Deployment.Current.Dispatcher.BeginInvoke(() =>
    {
        UpdateSyncPictureName(...);
        NotifyComplete();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm busy working on a windows phone application that calls a servlet that then
I am working on an app on Windows Phone and trying to get data
I have modified a working Windows service that had always been starting beforehand. After
I'm working at Windows Phone application these days and have faced the problem with
Working with a listbox in windows phone 7 I am trying to make an
I am working on a windows phone app (really big one) that has at
Presently I'm working on a Windows Phone application that will work in both online
I developed an app that is working fine on windows phone. The nature of
I'm working on a Windows Phone 7 Silverlight puzzle game that is sort of
So I am working on a windows phone app, and I am trying to

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.