Пример #1
0
        public StorageMethodsViewModel(BaseStorageStore storageStore, IPageService pageService)
        {
            this.storageStore = storageStore;
            this.pageService  = pageService;

            this.LoadDataCommand = new Command(async() => await LoadData());

            this.AddStorageCommand = new Command(async() => await AddStorage());
        }
        public StorageTypesViewModel(BaseStorageStore storageStore, IPageService pageService)
        {
            this.storageStore = storageStore;
            this.pageService  = pageService;

            this.LoadDataCommand = new Command(async() => await LoadData());

            this.AddStorageCommand = new Command(async() => await AddStorage());

            this.SelectedStorageCommand = new Command <StorageViewModel>(async c => await SelectStorage(c));

            this.DeleteStorageCommand = new Command <StorageViewModel>(async c => await DeleteStorage(c));
        }
Пример #3
0
        public StorageTypeDetailViewModel(StorageViewModel viewModel, BaseStorageStore storageStore, IPageService pageService)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            this.pageService  = pageService;
            this.storageStore = storageStore;

            this.SaveCommand   = new Command(async() => await Save());
            this.DeleteCommand = new Command <StorageViewModel>(async c => await Delete(viewModel));

            this.Storage = new Storage
            {
                Id           = viewModel.Id,
                StorageName  = viewModel.StorageName,
                Url          = viewModel.Url,
                DateAdded    = viewModel.DateAdded,
                DateModified = viewModel.DateModified
            };
        }