首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >windows 8导航:设备物理按钮问题

windows 8导航:设备物理按钮问题
EN

Stack Overflow用户
提问于 2013-10-07 08:06:40
回答 1查看 236关注 0票数 0

当页面间导航时,我要么按“开始”,要么按“搜索”按钮,这将使我从应用程序中脱颖而出。然后当我回到应用程序。它说导航服务为null或类似的东西。

我怎么能解决呢!?

代码语言:javascript
复制
Dispatcher.BeginInvoke(delegate()
                {
                    TextBlock b = (TextBlock)sender;

                    var CusId = (TextBlock)b.FindName("CusId");
                    var SCHTime1 = (TextBlock)b.FindName("pschtime");
                    int intCusId = Convert.ToInt32(CusId.Text);
                    string ScheduleTime = SCHTime1.Text;

                    LoginVM.GetCustomerDetail(intCusId);

                    if (LoginVM.OBCustomerDetail.Count != 0)
                    {
                        foreach (var c in LoginVM.OBCustomerDetail)
                        {
                            Common.CustomerNetworkId = c.CustomerNetworkId;
                            Common.intCustomerId = c.Id;
                            Common.CustomerName = c.Name;
                            Common.RouteId = c.RouteId.Value;
                            Common.strReportedTime = DateTime.Now.TimeOfDay.Hours + ":" + DateTime.Now.TimeOfDay.Minutes;

                        }
                        getVisitDetailNo();

                        if (VN == false)
                        {
                            myPopup.IsOpen = false;
                            backstatus = false;
                            return;
                        }
                        if (Common.visitDetailNo == null)
                        {
                            return;
                        }

                        if (LoginVM.SaveVisitedCustomer(Common.visitDetailNo, Common.strVisitHeaderNo, Common.RouteId, Common.intCustomerId, Common.SPOAccId, Common.intSalesRepId, Common.intAreaSalesManagerAccId, Common.intAreaSalesManagerId, Common.strTransactionDate, ScheduleTime, Common.strReportedTime) == true)
                        {
                            //update next Visit Detail No
                            if (UpdateVisitConfigTable() == true)
                            {
                                myPopup.IsOpen = false;
                                backstatus = false;
                                Common.urlstring = "/View/frmCustomerMenu.xaml";
                                NavigationService.Navigate(new Uri("/View/LoadingView.xaml", UriKind.Relative));

                                configVM = new ConfigViewModel();

                                //Bind Visited Outlets
                                bindVisited();
                            }
                            else
                        }
                    }


                });

上面的内容将指向loading.aspx及其代码,如下所示

代码语言:javascript
复制
GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            Dispatcher.BeginInvoke(delegate() {
                NavigationService.Navigate(new Uri(Common.urlstring, UriKind.Relative));
            });

错误来自于loading.aspx,尽管在此之前,我是从页面导航的。

突出显示在黄色-NavigationService.Navigate(新Uri(Common.urlstring,UriKind.Relative));

Common.urlstring = "/View/frmFirstTimeSync.xaml“

NavigationService =根据误差为零

http://www.tiikoni.com/tis/view/?id=95ecd7b

我不能发照片,因为我没有足够的声誉。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-07 09:55:57

以上问题运行FormLoad方法。我更改了导航服务的位置。

现在导航服务在OnNavigatedTo方法中工作。它很好用

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19219768

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档