本文整理匯總了C#中Prism.Regions.Region.Deactivate方法的典型用法代碼示例。如果您正苦於以下問題:C# Region.Deactivate方法的具體用法?C# Region.Deactivate怎麽用?C# Region.Deactivate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Prism.Regions.Region
的用法示例。
在下文中一共展示了Region.Deactivate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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));
}
示例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));
}
示例3: 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);
}
示例4: DeactivateNonAddedViewThrows
public void DeactivateNonAddedViewThrows()
{
IRegion region = new Region();
object nonAddedView = new object();
region.Deactivate(nonAddedView);
}