当前位置: 首页>>代码示例>>C#>>正文


C# Regions.NavigationContext类代码示例

本文整理汇总了C#中Prism.Regions.NavigationContext的典型用法代码示例。如果您正苦于以下问题:C# NavigationContext类的具体用法?C# NavigationContext怎么用?C# NavigationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NavigationContext类属于Prism.Regions命名空间,在下文中一共展示了NavigationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegionNavigationFailedEventArgs

        /// <summary>
        /// Initializes a new instance of the <see cref="RegionNavigationEventArgs"/> class.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        public RegionNavigationFailedEventArgs(NavigationContext navigationContext)
        {
            if (navigationContext == null)
                throw new ArgumentNullException(nameof(navigationContext));

            this.NavigationContext = navigationContext;
        }
开发者ID:Citringo,项目名称:Prism,代码行数:11,代码来源:RegionNavigationFailedEventArgs.cs

示例2: OnNavigatedTo

        /// <summary>
        ///     Called when the implementer has been navigated to.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        public override void OnNavigatedTo(NavigationContext navigationContext)
        {
            base.OnNavigatedTo(navigationContext);

            Invoices.Clear();
            Invoices.AddRange(ConManager.GetAllInvoices());
        }
开发者ID:George-Andras,项目名称:HomeInventories,代码行数:11,代码来源:InvoicesViewModel.cs

示例3: RaiseNavigated

 private void RaiseNavigated(NavigationContext navigationContext)
 {
     if (this.Navigated != null)
     {
         this.Navigated(this, new RegionNavigationEventArgs(navigationContext));
     }
 }
开发者ID:Citringo,项目名称:Prism,代码行数:7,代码来源:RegionNavigationService.cs

示例4: WhenRegionHasMultipleViews_ThenViewsWithMatchingFullTypeNameAreConsidered

        public void WhenRegionHasMultipleViews_ThenViewsWithMatchingFullTypeNameAreConsidered()
        {
            // Arrange

            var serviceLocatorMock = new Mock<IServiceLocator>();

            var region = new Region();

            var view1 = new TestView();
            var view2 = "view";

            region.Add(view1);
            region.Add(view2);

            var navigationContext = new NavigationContext(null, new Uri(view2.GetType().FullName, UriKind.Relative));

            var navigationTargetHandler = new TestRegionNavigationContentLoader(serviceLocatorMock.Object);

            // Act

            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);

            // Assert

            Assert.AreSame(view2, returnedView);
        }
开发者ID:ValdimarThor,项目名称:Prism,代码行数:26,代码来源:LocatorNavigationTargetHandlerFixture.cs

示例5: WhenAskedCanNavigateForDifferentQuery_ThenReturnsFalse

        public void WhenAskedCanNavigateForDifferentQuery_ThenReturnsFalse()
        {
            var email = new EmailDocument();

            var emailServiceMock = new Mock<IEmailService>();
            emailServiceMock
                .Setup(svc => svc.GetEmailDocument(email.Id))
               .Returns(email)
               .Verifiable();

            var viewModel = new EmailViewModel(emailServiceMock.Object);

            NavigationContext context = new NavigationContext(new Mock<IRegionNavigationService>().Object, new Uri("location", UriKind.Relative));
            context.Parameters.Add("EmailId", email.Id);
            
            ((INavigationAware)viewModel).OnNavigatedTo(context);

            context = new NavigationContext(new Mock<IRegionNavigationService>().Object, new Uri("location", UriKind.Relative));
            context.Parameters.Add("EmailId", new Guid());

            bool canNavigate =
                ((INavigationAware)viewModel).IsNavigationTarget(context);

            Assert.IsFalse(canNavigate);
        }
开发者ID:transformersprimeabcxyz,项目名称:Prism-Samples-Wpf,代码行数:25,代码来源:EmailViewModelFixture.cs

示例6: WhenNoCurrentMatchingViewExists_ThenReturnsNewlyCreatedInstanceWithServiceLocatorAddedToTheRegion

        public void WhenNoCurrentMatchingViewExists_ThenReturnsNewlyCreatedInstanceWithServiceLocatorAddedToTheRegion()
        {
            // Arrange

            var serviceLocatorMock = new Mock<IServiceLocator>();

            var region = new Region();

            var view = new TestView();

            serviceLocatorMock
                .Setup(sl => sl.GetInstance<object>(view.GetType().Name))
                .Returns(view);

            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));

            var navigationTargetHandler = new TestRegionNavigationContentLoader(serviceLocatorMock.Object);

            // Act

            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);

            // Assert

            Assert.AreSame(view, returnedView);
            Assert.IsTrue(region.Views.Contains(view));
        }
开发者ID:ValdimarThor,项目名称:Prism,代码行数:27,代码来源:LocatorNavigationTargetHandlerFixture.cs

示例7: WhenViewExistsAndDoesNotImplementINavigationAware_ThenReturnsView

        public void WhenViewExistsAndDoesNotImplementINavigationAware_ThenReturnsView()
        {
            // Arrange

            var serviceLocatorMock = new Mock<IServiceLocator>();

            var region = new Region();

            var view = new TestView();

            region.Add(view);

            var navigationContext = new NavigationContext(null, new Uri(view.GetType().Name, UriKind.Relative));

            var navigationTargetHandler = new TestRegionNavigationContentLoader(serviceLocatorMock.Object);


            // Act

            var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);


            // Assert

            Assert.AreSame(view, returnedView);
        }
开发者ID:Citringo,项目名称:Prism,代码行数:26,代码来源:LocatorNavigationTargetHandlerFixture.cs

示例8: OnNavigatedTo

 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     _player = (from player in _state.Context.Players
         where
             player.Id == (int) navigationContext.Parameters["player"]
         select player).FirstOrDefault();
 }
开发者ID:TheAirlineProject,项目名称:tap-desktop,代码行数:7,代码来源:PageAirlineDataViewModel.cs

示例9: OnNavigatedFrom

 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     IRFIDService rfidService = container.Resolve<IRFIDService>();
     rfidService.stop();
     eventAggregator.GetEvent<RFIDNewItemEvent>().Unsubscribe(handleNewItemFromRFID);
     eventAggregator.GetEvent<RFIDHardwareEvent>().Unsubscribe(handleErrorFromRFID);
     eventAggregator.GetEvent<DatabaseEvent>().Unsubscribe(handleErrorFromDatabase);
 }
开发者ID:heyuantao,项目名称:BookLocationProject,代码行数:8,代码来源:BookLocationShowViewModel.cs

示例10: ArgumentNullException

 void INavigationAware.OnNavigatedTo(NavigationContext navigationContext)
 {
     if (navigationContext == null)
     {
         throw new ArgumentNullException("navigationContext");
     }
     Name = navigationContext.Parameters["Name"] as string;
 }
开发者ID:countincognito,项目名称:Zametek.PrismEx.AvalonDock,代码行数:8,代码来源:DocumentViewModel.cs

示例11: OnNavigatedTo

        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            //Start running a script
            string filename = (string)navigationContext.Parameters["filename"];

            _script = new TaiScript(filename,TAIClient.taiClient);
            _script.Start();
        }
开发者ID:t0b1z,项目名称:A-CAT,代码行数:8,代码来源:ScriptRunningViewModel.cs

示例12: OnNavigatedTo

        /// <summary>
        ///     Called when the implementer has been navigated to.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        public override void OnNavigatedTo(NavigationContext navigationContext)
        {
            base.OnNavigatedTo(navigationContext);

            {
                Clients.AddRange(ConManager.GetAllClients());
            }
        }
开发者ID:George-Andras,项目名称:HomeInventories,代码行数:12,代码来源:ClientsViewModel.cs

示例13: RegionNavigationEventArgs

        /// <summary>
        /// Initializes a new instance of the <see cref="RegionNavigationEventArgs"/> class.
        /// </summary>
        /// <param name="navigationContext">The navigation context.</param>
        public RegionNavigationEventArgs(NavigationContext navigationContext)
        {
            if (navigationContext == null)
            {
                throw new ArgumentNullException("navigationContext");
            }

            this.NavigationContext = navigationContext;
        }
开发者ID:ValdimarThor,项目名称:Prism,代码行数:13,代码来源:RegionNavigationEventArgs.cs

示例14: OnNavigatedTo

        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            if (PlugInNames.Count != 0)
                return;

            foreach(ModuleInfo mi in _moduleCatalog.Modules)
            {
                if(mi.ModuleName != "PlugInHomeModule" && mi.ModuleName != "StartScreenModule")
                    PlugInNames.Add(mi.ModuleName);
            }
        }
开发者ID:t0b1z,项目名称:FrameworkTest,代码行数:11,代码来源:PlugInHomeViewModel.cs

示例15: IsNavigationTarget

 public bool IsNavigationTarget(NavigationContext navigationContext)
 {
     var toCategoryTitle = ((CategoryVO) navigationContext.Parameters["To"]).Title;
     if (Title == toCategoryTitle)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:ProductiveEngine,项目名称:KnowledgeBase,代码行数:12,代码来源:CategoryInfoViewModel.cs


注:本文中的Prism.Regions.NavigationContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。