public AccountVM() { NewAccountCommand = new CommandAsync(NewAccount); DeleteAccountCommand = new CommandAsync(DeleteAccount); dispatcherTimer.Tick += Refresh; dispatcherTimer.Interval = new TimeSpan(0, 0, 1); dispatcherTimer.Start(); }
public CompanyVM() { //ExecuteLoadCompanies(); CompanyChangedCommand = new CommandAsync(SetCompID); dispatcherTimer.Tick += Refresh; dispatcherTimer.Interval = new TimeSpan(0, 0, 1); dispatcherTimer.Start(); }
public NetDiskFileNodeViewModel(IUnityContainer container, IMountUserRepository mountUserRepository, INetDiskFile netDiskFile) : base(container) { _mountUserRepository = mountUserRepository; _netDiskFile = netDiskFile; DeleteFileCommand = new Command(DeleteFileCommandExecuteAsync); DownloadFileCommand = new Command(DownloadFileCommandExecuteAsync); RefreshChildrenCommandAsync = new CommandAsync(RefreshChildrenCommandExecuteAsync, () => !RefreshChildrenCommandAsync.IsWorking); EventAggregator.GetEvent <DownloadStateChangedEvent>().Subscribe( OnDownloadStateChanged, Prism.Events.ThreadOption.UIThread, keepSubscriberReferenceAlive: false, filter: e => e.FileId == FileId); EventAggregator.GetEvent <DownloadProgressChangedEvent>().Subscribe( OnDownloadProgressChanged, Prism.Events.ThreadOption.UIThread, keepSubscriberReferenceAlive: false, filter: e => e.FileId == FileId); }
public void ConstructHimself() { _ = new CommandAsync(_actionToExecute); }
public void TestInitialize() { _actualCount = 0; _actionToExecute = () => _actualCount++; _sut = new CommandAsync(_actionToExecute); }