public AppSummaryViewModel(ApplicationViewModel model)
        {
            ApplicationTuple      = model.ApplicationTuple;
            OpenModFolderCommand  = new OpenModFolderCommand(this);
            ConfigureModCommand   = new ConfigureModCommand(this);
            _applicationViewModel = model;

            // Wait for parent to fully initialize.
            _applicationViewModel.OnGetModsForThisApp += BuildModList;
            _applicationViewModel.OnLoadModSet        += BuildModList;
            BuildModList();

            SelectedMod = AllMods.FirstOrDefault();
        }
Example #2
0
    /// <inheritdoc />
    public ConfigureModsViewModel(ApplicationViewModel model, ModUserConfigService userConfigService)
    {
        ApplicationTuple      = model.ApplicationTuple;
        _applicationViewModel = model;
        _userConfigService    = userConfigService;
        _saveToken            = new CancellationTokenSource();

        // Wait for parent to fully initialize.
        _applicationViewModel.OnGetModsForThisApp += BuildModList;
        _applicationViewModel.OnLoadModSet        += BuildModList;
        BuildModList();

        SelectedMod      = AllMods.FirstOrDefault();
        PropertyChanged += OnSelectedModChanged;
        UpdateCommands();
    }
Example #3
0
 public Mod GetModFromLocal(InstalledMod mod)
 {
     return(AllMods.FirstOrDefault((e) => e.Version == mod.Version && string.Compare(e.Name, mod.Name, StringComparison.OrdinalIgnoreCase) == 0));
 }
Example #4
0
 public Mod GetModFromId(string id)
 {
     return(AllMods.FirstOrDefault((e) => string.Compare(e.Id, id, StringComparison.OrdinalIgnoreCase) == 0));
 }