C# Windows phone 8和phonegap 2.7.0,HTML页面和Xaml之间的导航

C# Windows phone 8和phonegap 2.7.0,HTML页面和Xaml之间的导航,c#,javascript,cordova,windows-phone-8,C#,Javascript,Cordova,Windows Phone 8,我正在开发一个应用程序,它将有一个单独的摄像头功能。原因是我不喜欢phonegap的内置getPicture for windows phone,因为它会自动将图像保存在用户设备上,这会占用大量内存 我的应用程序目前的工作方式 用户打开应用程序,应用程序将他们引导到login.html页面(在其中输入用户名/密码),然后进入menu.html,在那里他们有许多不同的选项/功能其中一个是拍照按钮,它在camera.html页面中打开camera.html我有这个代码,它调用我的单独Echo.cs类

我正在开发一个应用程序,它将有一个单独的摄像头功能。原因是我不喜欢phonegap的内置getPicture for windows phone,因为它会自动将图像保存在用户设备上,这会占用大量内存

我的应用程序目前的工作方式

用户打开应用程序,应用程序将他们引导到login.html页面(在其中输入用户名/密码),然后进入menu.html,在那里他们有许多不同的选项/功能其中一个是拍照按钮,它在camera.html页面中打开camera.html我有这个代码,它调用我的单独Echo.cs类/插件工具

        cordova.exec(function (imageData) { onPhotoDataSuccess(imageData); }, function (err) {
            alert("Intent Error. Unable to call update routines");
        }, "Echo", "takePicture", ["takepicture"]);
我的拍摄方法如下所示:

    public void takePicture(string options)
    {
        string takePic = null;
        Debug.WriteLine("Reached imageconvert method");
        try
        {
            string[] data = JsonHelper.Deserialize<string[]>(options);
            takePic = data[0];


        }
        catch (Exception)
        {
            Debug.WriteLine("ERROR OCCURED!");
            DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
            return;
        }


        if ((takePic != null) && (takePic.Length > 0))
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                (Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/Camera.xaml", UriKind.Relative));

                //logic here some way to get the image back from camera.xaml and resume my currant page.
            });


            //DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "imaged passed back from camera.xaml should go here"));
        }
        else
        {
            DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Expected one non-empty string argument."));
            return;
        }
    }
public-void-takePicture(字符串选项)
{
字符串takePic=null;
WriteLine(“到达的imageconvert方法”);
尝试
{
string[]data=JsonHelper.Deserialize(选项);
takePic=数据[0];
}
捕获(例外)
{
Debug.WriteLine(“发生错误!”);
DispatchCommandResult(新的PluginResult(PluginResult.Status.JSON_异常));
返回;
}
如果((takePic!=null)&&(takePic.Length>0))
{
Deployment.Current.Dispatcher.BeginInvoke(()=>
{
(Application.Current.RootVisual作为PhoneApplicationFrame)导航(新Uri(“/Camera.xaml”,UriKind.Relative));
//这里的逻辑是通过某种方式从camera.xaml获取图像并继续我的当前页面。
});
//DispatchCommandResult(新的PluginResult(PluginResult.Status.OK,“从camera.xaml传回的图像应该放在这里”);
}
其他的
{
DispatchCommandResult(新的PluginResult(PluginResult.Status.ERROR,“应为一个非空字符串参数”);
返回;
}
}
上面的代码将用户重定向到我创建的一个单独的camera.xaml页面,在该页面中,我的自定义相机处理图像而不将其保存到用户库,并将其转换为编码的64basestring以作为ImageData发送回,我现在的问题是,有没有办法将ImageData信息发送回一些how并从Camera.html页面恢复我的应用程序?这在phonegap中可能吗?

我曾经支持:

DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "imaged passed back from   camera.xaml should go here"));
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
    root = Application.Current.RootVisual as PhoneApplicationFrame;
    root.GoBack();
});
如果使用root.Navigate(新Uri(“/MainPage.xaml”,UriKind.Relative));将丢失实际页面并返回索引


对不起,我的英语

你能解决上面的问题吗?