private async Task BuildStepViewModelAsync(TemplateType templateType) { var hasTemplates = DataService.HasTemplatesFromType(templateType, Platform, ProjectType.Selected.Name, Framework.Selected.Name); var stepId = templateType.GetNewProjectStepId(); var isStepAdded = StepsViewModels.ContainsKey(templateType); if (hasTemplates) { if (!isStepAdded) { var stepTitle = templateType.GetNewProjectStepTitle(); var pageTitle = templateType.GetStepPageTitle(); var step = new TemplatesStepViewModel(templateType, Platform, ProjectType.Selected.Name, Framework.Selected.Name, pageTitle); step.LoadData(); StepsViewModels.Add(templateType, step); WizardNavigation.Current.AddNewStep(stepId, stepTitle, () => new TemplatesStepPage(templateType)); } else { var step = StepsViewModels[templateType]; step.ResetData(ProjectType.Selected.Name, Framework.Selected.Name); } } else if (!hasTemplates && isStepAdded) { StepsViewModels.Remove(templateType); await WizardNavigation.Current.RemoveStepAsync(stepId); } }