本文整理汇总了C#中Prism.Regions.Region.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Region.Remove方法的具体用法?C# Region.Remove怎么用?C# Region.Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prism.Regions.Region
的用法示例。
在下文中一共展示了Region.Remove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveInexistentViewThrows
public void RemoveInexistentViewThrows()
{
IRegion region = new Region();
object view = new object();
region.Remove(view);
Assert.AreEqual(0, region.Views.Cast<object>().Count());
}
示例2: CanRemoveContentFromRegion
public void CanRemoveContentFromRegion()
{
IRegion region = new Region();
object view = new object();
region.Add(view);
region.Remove(view);
Assert.AreEqual(0, region.Views.Cast<object>().Count());
}
示例3: WhenViewHasBeenRemovedAndRegionManagerPropertyCleared_ThenItCanBeAddedAgainToARegion
public void WhenViewHasBeenRemovedAndRegionManagerPropertyCleared_ThenItCanBeAddedAgainToARegion()
{
IRegion region = new Region { RegionManager = new MockRegionManager() };
var view = new MockFrameworkElement();
var scopedRegionManager = region.Add(view, null, true);
Assert.AreEqual(view, region.Views.First());
region.Remove(view);
view.ClearValue(RegionManager.RegionManagerProperty);
Assert.AreEqual(0, region.Views.Cast<object>().Count());
var newScopedRegion = region.Add(view, null, true);
Assert.AreEqual(view, region.Views.First());
Assert.AreSame(newScopedRegion, view.GetValue(RegionManager.RegionManagerProperty));
}
示例4: ViewRemovedEventPassesTheViewRemovedInTheEventArgs
public void ViewRemovedEventPassesTheViewRemovedInTheEventArgs()
{
object removedView = null;
IRegion region = new Region();
region.Views.CollectionChanged += (sender, e) =>
{
if (e.Action == NotifyCollectionChangedAction.Remove)
removedView = e.OldItems[0];
};
object model = new object();
region.Add(model);
Assert.IsNull(removedView);
region.Remove(model);
Assert.AreSame(model, removedView);
}
示例5: RemovingViewAlsoRemovesItFromActiveViews
public void RemovingViewAlsoRemovesItFromActiveViews()
{
IRegion region = new Region();
object model = new object();
region.Add(model);
region.Activate(model);
Assert.IsTrue(region.ActiveViews.Contains(model));
region.Remove(model);
Assert.IsFalse(region.ActiveViews.Contains(model));
}
示例6: RemoveViewFiresViewRemovedEvent
public void RemoveViewFiresViewRemovedEvent()
{
bool viewRemoved = false;
IRegion region = new Region();
object model = new object();
region.Views.CollectionChanged += (sender, e) =>
{
if (e.Action == NotifyCollectionChangedAction.Remove)
viewRemoved = true;
};
region.Add(model);
Assert.IsFalse(viewRemoved);
region.Remove(model);
Assert.IsTrue(viewRemoved);
}
示例7: GetViewReturnsNullAfterRemovingViewFromRegion
public void GetViewReturnsNullAfterRemovingViewFromRegion()
{
IRegion region = new Region();
object myView = new object();
region.Add(myView, "MyView");
region.Remove(myView);
Assert.IsNull(region.GetView("MyView"));
}