public void BuildAppServiceTable(string appSerivceTag) { AppTierTable.Clear(); ServiceTableItem tableItem = null; AppService service = Services.FirstOrDefault( x => x.Tag == appSerivceTag); AppServiceSubscription subscription = null; SelectedAppServiceTableItem = null; if (_editApp.Subscriptions != null) { subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "app"); } foreach (var tier in service.Tiers) { tableItem = CreateServiceTableItem(tier); AppTierTable.Add(tableItem); if (subscription != null && subscription.ServiceTier.Id == tableItem.Tier.Id) { SelectedAppServiceTableItem = tableItem; } } OnPropertyChanged("AppTierTable"); }
public void ResetAppServiceTable() { ObservableCollection <AppServiceTier> appTiers = null; AppServiceTier selectTier = null; if (_upgradableAppTiers.Any()) { appTiers = _upgradableAppTiers; selectTier = _upgradeAppServiceTier; } else { if (_editApp.Subscriptions != null) { var subscription = _editApp.Subscriptions.FirstOrDefault( x => (x.ServiceTier.OwnedBy as AppService).Type == "app"); selectTier = subscription.ServiceTier; SelectedAppServiceTag = (selectTier.OwnedBy as AppService).Tag; } else { SelectedAppServiceTag = DefaultAppServiceTag; } appTiers = AppService.Tiers; } AppTierTable.Clear(); ServiceTableItem tableItem = null; foreach (var tier in appTiers) { tableItem = CreateServiceTableItem(tier); AppTierTable.Add(tableItem); if (selectTier != null && selectTier.Id == tableItem.Tier.Id) { SelectedAppServiceTableItem = tableItem; } } OnPropertyChanged("AppTierTable"); }