/// <summary>
 /// Initializes a new instance of the <see cref="SolutionPlatformViewModel"/> class.
 /// </summary>
 /// <param name="serviceProvider">The service provider for this view model.</param>
 /// <param name="solutionPlatform">The solution platform represented by the view model.</param>
 /// <param name="isAlreadyInstalled">Indicates whether this plaform is already installed in the related package.</param>
 /// <param name="initiallySelected">Indicates whether this plaform should be initially selected.</param>
 public SolutionPlatformViewModel(IViewModelServiceProvider serviceProvider, SolutionPlatform solutionPlatform, bool isAlreadyInstalled, bool initiallySelected)
     : base(serviceProvider)
 {
     SolutionPlatform     = solutionPlatform;
     IsAvailableOnMachine = solutionPlatform.IsAvailable;
     IsSelected           = initiallySelected;
     IsAlreadyInstalled   = isAlreadyInstalled;
     DependentProperties.Add(nameof(IsSelected), new[] { nameof(MarkedToRemove) });
     SelectedTemplate = AvailableTemplates.FirstOrDefault();
 }
Esempio n. 2
0
 private ITemplate GetTemplateByName(string name)
 => AvailableTemplates.FirstOrDefault(t => t.Identifier == name);