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


C# Region.Deactivate方法代码示例

本文整理汇总了C#中Microsoft.Practices.Prism.Regions.Region.Deactivate方法的典型用法代码示例。如果您正苦于以下问题:C# Region.Deactivate方法的具体用法?C# Region.Deactivate怎么用?C# Region.Deactivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Practices.Prism.Regions.Region的用法示例。


在下文中一共展示了Region.Deactivate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShouldFindCandidateViewWithFriendlyNameInRegion

        public void ShouldFindCandidateViewWithFriendlyNameInRegion()
        {
            this.ConfigureMockServiceLocator();

            // We cannot access the MefRegionNavigationContentLoader directly so we need to call its
            // GetCandidatesFromRegion method through a navigation request.
            IRegion testRegion = new Region();

            MockView2 view = new MockView2();
            testRegion.Add(view);
            testRegion.Deactivate(view);

            testRegion.RequestNavigate("SomeView");

            Assert.IsTrue(testRegion.Views.Contains(view));
            Assert.IsTrue(testRegion.Views.Count() == 1);
            Assert.IsTrue(testRegion.ActiveViews.Count() == 1);
            Assert.IsTrue(testRegion.ActiveViews.Contains(view));
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:19,代码来源:MefRegionNavigationContentLoaderFixture.cs

示例2: ShouldFindCandidateViewInRegion

        public void ShouldFindCandidateViewInRegion()
        {
            IUnityContainer container = new UnityContainer();
            container.RegisterType<object, MockView>("MockView");

            this.ConfigureMockServiceLocator(container);

            // We cannot access the UnityRegionNavigationContentLoader directly so we need to call its
            // GetCandidatesFromRegion method through a navigation request.
            IRegion testRegion = new Region();

            MockView view = new MockView();
            testRegion.Add(view);
            testRegion.Deactivate(view);

            testRegion.RequestNavigate("MockView");

            Assert.IsTrue(testRegion.Views.Contains(view));
            Assert.IsTrue(testRegion.Views.Count() == 1);
            Assert.IsTrue(testRegion.ActiveViews.Count() == 1);
            Assert.IsTrue(testRegion.ActiveViews.Contains(view));
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:22,代码来源:UnityRegionNavigationContentLoaderFixture.cs

示例3: DeactivateNonAddedViewThrows

        public void DeactivateNonAddedViewThrows()
        {
            IRegion region = new Region();

            object nonAddedView = new object();

            Assert.ThrowsException<ArgumentException>(() => region.Deactivate(nonAddedView));
        }
开发者ID:ZeroInfinite,项目名称:PortablePrism,代码行数:8,代码来源:RegionFixture.cs

示例4: DeactivateNonAddedViewThrows

        public void DeactivateNonAddedViewThrows()
        {
            IRegion region = new Region();

            object nonAddedView = new object();

            region.Deactivate(nonAddedView);
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:8,代码来源:RegionFixture.cs

示例5: WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewNotInActiveViewsIsNotUpdated

        public void WhenParentViewGetsActivatedOrDeactivated_ThenSyncedChildViewNotInActiveViewsIsNotUpdated()
        {
            var scopedRegionManager = new RegionManager();
            var scopedRegion = new Region { Name="MyScopedRegion", RegionManager = scopedRegionManager };
            scopedRegionManager.Regions.Add(scopedRegion);
            var behaviorForScopedRegion = new RegionActiveAwareBehavior { Region = scopedRegion };
            behaviorForScopedRegion.Attach();
            var childActiveAwareView = new SyncedActiveAwareObject();

            var region = new MockPresentationRegion();
            var behavior = new RegionActiveAwareBehavior { Region = region };
            behavior.Attach();

            var view = new MockFrameworkElement();
            region.Add(view);
            RegionManager.SetRegionManager(view, scopedRegionManager);
            region.Activate(view);

            scopedRegion.Add(childActiveAwareView);
            scopedRegion.Deactivate(childActiveAwareView);

            Assert.IsFalse(childActiveAwareView.IsActive);

            region.Deactivate(view);

            Assert.IsFalse(childActiveAwareView.IsActive);

            region.Activate(view);

            Assert.IsFalse(childActiveAwareView.IsActive);
        }
开发者ID:selvendiranj,项目名称:compositewpf-copy,代码行数:31,代码来源:RegionActiveAwareBehaviorFixture.cs


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