public BrowseTabViewModel() { Mods = new ObservableCollection<ModDatabaseModViewModel>(); modDatabase = new ModDatabase(); PropertyChanged += (o, e) => { if (e.PropertyName == "BrowseModsIsSelected" && BrowseModsIsSelected) LazyLoadMods(); }; }
public ModDatabaseModViewModel(ModDatabaseMod mod, ModDatabase database) { this.mod = mod; this.timer = new Timer(); this.database = database; this.saver = new DownloadedModSaver(); this.extractor = new ModExtracter(); DownloadModCommand = new Command(DownloadMod, x => !IsDownloading); timer.AutoReset = false; timer.Elapsed += (o, e) => { ModHasBeenDownloaded = false; timer.Stop(); }; timer.Interval = TimeSpan.FromSeconds(5).TotalMilliseconds; }