English 中文(简体)
从确认导航请求请求到棱晶导航服务器的通过参数
原标题:Pass parameters from ConfirmNavigationRequest to NavigationService in Prism

我有一个执行 IConfirmNavigation Request 的查看模型, 执行 IConfirmurationNavigation Request http://msdn.microsoft.com/en-us/library/gg430861%28v=pandp.40%%29.aspx#sec10" rel="nofollow"。 我需要将这个查看模型的信息 传送到一个我拥有的导航中介类, 与任何特定的观点或查看模型无关。

相反,导航代理商类可以访问感兴趣的IRegion 以及IRegion Navigation Service

ViewModel Adding Parameters to Uri

    public override void ConfirmNavigationRequest(NavigationContext navigationContext,
                                                  Action<bool> continuationCallback)
    {
        _verificationCount++;
        navigationContext.Parameters.Add("Count", _verificationCount.ToString());
        continuationCallback(Verify());
    }

A Navigation Broker that Needs To Access the Passed Parameters

    // Some method
    _region.RequestNavigate(new Uri(_nextView, UriKind.Relative), NavigationCallback);

    private void NavigationCallback(NavigationResult navigationResult)
    {            
        if (navigationResult.Error == null)
        {
            if (navigationResult.Result == true)
            {
                // Need to evaluate the Count argument here
                // int count = ...
                // if (count < 5)
                QueueNextView();                     
            } else
            {
                Debug.WriteLine("Navigation Cancelled");
            }
        }
        else
        {
             Debug.WriteLine("Navigation Error");                
        }
    }

How to Access Parameter Through Region or NavigationService, Outside ViewModel?

  • I cannot find a way to access NavigationContext through NavigationService or Region?
  • I also tried this _region.NavigationService.Journal.CurrentEntry.Uri.OriginalString but it did not show any query information, just the registered View string name
最佳回答
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签