public async Task RemoveRegion(IAdaptableRegion region) { if (region == null) { throw new ArgumentNullException("region", "region is null."); } var adaptRegion = region as Internal.AdaptableRegion; if (adaptRegion == null) { throw new ArgumentException("given region is no instance of AdaptableRegion"); } var regionName = _regions.FirstOrDefault(kvp => kvp.Value.Object == region).Key; if (regionName == null) { throw new ArgumentException("given region is not contained in container"); } IScopedLifetime <Internal.AdaptableRegion> scope; if (_regions.TryRemove(regionName, out scope)) { await scope.Object.NavigableRegion.CloseAll(); scope.Dispose(); } }
private static void AddNewView(IAdaptableRegion tabRegion) { var naviParams = NavigationParameters.Create() .Add("value", _viewModelCount++); tabRegion.RequestNavigate <SampleViewModel>(naviParams); }
public bool ContainsRegion(IAdaptableRegion region) { if (region == null) { throw new ArgumentNullException("region", "region is null."); } return(_regions.Any(kvp => kvp.Value.Object == region as Internal.AdaptableRegion)); }