예제 #1
0
 private bool FillAccontPageInfo(PasswordBox passwordBox, IMountUser user)
 {
     if (user == null)
     {
         return(false);
     }
     IsRememberPassword   = true;
     Username             = user.Username;
     passwordBox.Password = user.PasswordEncrypted;
     return(true);
 }
예제 #2
0
        public DownloadingTaskItemViewModel(IUnityContainer container, IMountUser localDiskUser, IDiskFile diskFile)
            : base(container, diskFile)
        {
            // TODO: Temporary solution.
            _localDiskUser = localDiskUser;

            PauseTaskCommand  = new Command(PauseTaskCommandExecute, () => DownloadState == DownloadStateEnum.Downloading || DownloadState == DownloadStateEnum.Waiting);
            StartTaskCommand  = new Command(StartTaskCommandExecute, () => DownloadState == DownloadStateEnum.Paused);
            CancelTaskCommand = new Command(CancelTaskCommandExecute);

            EventAggregator.GetEvent <DownloadProgressChangedEvent>().Subscribe(OnDownloadProgressChanged,
                                                                                ThreadOption.UIThread,
                                                                                keepSubscriberReferenceAlive: false,
                                                                                filter: e => e.FileId == FileId);
            EventAggregator.GetEvent <DownloadStateChangedEvent>().Subscribe(OnDownloadStateChanged,
                                                                             ThreadOption.UIThread,
                                                                             keepSubscriberReferenceAlive: false,
                                                                             filter: e => e.FileId == FileId);
        }