本文整理匯總了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"));
}