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

  • Home
  • SEARCH
  • 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 7509329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:52:45+00:00 2026-05-29T22:52:45+00:00

I have a simple application that has a single page with a button that

  • 0

I have a simple application that has a single page with a button that invokes the CameraCaptureTask in Windows Phone 7. I use the MVVM pattern for this. My code behind is clean and I have offloaded the button click response to the ViewModel using behaviors. My code looks like this:

 public class MainViewModel : ViewModelBase
{
    private readonly CameraCaptureTask cameraCaptureTask;

    /// <summary>
    ///   Initializes a new instance of the MainViewModel class.
    /// </summary>
    public MainViewModel()
    {
        if (IsInDesignMode)
        {
            // Code runs in Blend --> create design time data.
        }
        else
        {
            cameraCaptureTask = new CameraCaptureTask();
            cameraCaptureTask.Completed += cameraCaptureTask_Completed;
            CaptureCommand = new RelayCommand(() => CaptureImage());
        }
    }

    public RelayCommand CaptureCommand { get; set; }

    private void cameraCaptureTask_Completed(object sender, PhotoResult e)
    {
        if (e == null || e.TaskResult != TaskResult.OK)
        {
            return;
        }
        else
        {
            // TODO
        }
    }

    private object CaptureImage()
    {
        cameraCaptureTask.Show();
        return null;
    }
}

Now when I run my application and hit the button that binds to the ‘CaptureCommand’ RelayCommand, I hit my breakpoint in the ‘CaptureCommand()’ method and it fires the ‘Show()’ method of the CameraCaptureTask resulting in my camera coming up on the device successfully. However once I complete taking a picture and hit ‘Accept’, the ‘cameraCaptureTask_Completed(object sender, Photoresult e)’ event handler never gets invoked. Am I missing something here?

Thanks in advance!

  • 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-29T22:52:46+00:00Added an answer on May 29, 2026 at 10:52 pm

    Why are you relaying this when you have just a show?

    Try moving the cameraCaptureTask out of the Constructor and into an invoked method

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

Sidebar

Related Questions

I have a simple iPhone application that is very similar to the Page Control
enter code here Hi All, I have a simple windows service application that connects
I have a simple HTML (as HTA) application that shows strange behavior on Windows
I have a struts2 application with a single page that may show one of
I have a simple application that loads an unmanaged dll and passes a few
I have a simple c++ application that generates reports on the back end of
I have a simple WPF application that uses ClickOnce to handle installing. Within this
I have a simple test application (C# console application) that does an HTTP GET
I have a simple Desktop Facebook application that allows the user to retrieve some
I have got a Wavecom Supreme GSM modem. I wrote a simple application that

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.