Пример #1
0
        public DownloadStashViewModel(IDialogCoordinator dialogCoordinator, IPersistentData persistentData, StashViewModel stash)
        {
            _stash             = stash;
            _persistenData     = persistentData;
            _dialogCoordinator = dialogCoordinator;
            DisplayName        = L10n.Message("Download & Import Stash");
            Build = persistentData.CurrentBuild;

            if (Build.League != null && _persistenData.LeagueStashes.ContainsKey(Build.League))
            {
                _tabs = new List <StashBookmark>(_persistenData.LeagueStashes[Build.League]);
            }
            TabsView = new ListCollectionView(_tabs);
            TabsView.CurrentChanged += (sender, args) => UpdateTabLink();

            Build.PropertyChanged += BuildOnPropertyChanged;
            BuildOnPropertyChanged(this, null);

            _viewLoadedCompletionSource = new TaskCompletionSource <object>();
            if (CurrentLeagues == null)
            {
                CurrentLeagues = new NotifyingTask <IReadOnlyList <string> >(LoadCurrentLeaguesAsync(),
                                                                             async e =>
                {
                    await _viewLoadedCompletionSource.Task;
                    await _dialogCoordinator.ShowWarningAsync(this,
                                                              L10n.Message("Could not load the currently running leagues."), e.Message);
                });
            }
        }
Пример #2
0
 public StashTabDropTarget(StashViewModel stashViewModel)
 {
     _stashViewModel = stashViewModel;
 }