private void InitSaveInvoiceCommand() { SaveInvoiceCommand = new DelegateCommand <object>(OnSaveInvoice, OnCanSaveInvoce); SaveInvoiceCommand.ObservesProperty(() => IsNotBusy); SaveInvoiceCommand.ObservesProperty(() => InvoiceBindProp); SaveInvoiceCommand.ObservesProperty(() => InvoiceBindProp.Items.Count); }
private void InitSaveCommand() { SaveCommand = new DelegateCommand <object>(OnSave, CanExecuteSave); SaveCommand.ObservesProperty(() => IsNotBusy); SaveCommand.ObservesProperty(() => ItemBindProp.Name); SaveCommand.ObservesProperty(() => ItemBindProp.Value); }
private void InitLoginCommand() { LoginCommand = new DelegateCommand <object>(OnLogin, CanLogin); LoginCommand.ObservesProperty(() => IsNotBusyBindProp); LoginCommand.ObservesProperty(() => EmailBindProp); LoginCommand.ObservesProperty(() => PassBindProp); }
private void InitPayCommand() { PayCommand = new DelegateCommand <object>(OnPay, OnCanPay); PayCommand.ObservesProperty(() => IsNotBusy); PayCommand.ObservesProperty(() => InvoiceBindProp); PayCommand.ObservesProperty(() => InvoiceBindProp.Items.Count); }
private void InitLoginCommand() { LoginCommand = new DelegateCommand <object>(OnLogin, CanExecuteLogin); LoginCommand.ObservesProperty(() => IsNotBusy); LoginCommand.ObservesProperty(() => UsernameBindProp); LoginCommand.ObservesProperty(() => PasswordBindProp); }
public SignInViewModel(INavigationService navigationService, IUserService userService) : base(navigationService) { var c = System.Globalization.CultureInfo.CurrentUICulture; SignInCommand = new DelegateCommand(async() => { HasLongActivity = true; var user = await userService.SignInAsync(Login, Password); HasLongActivity = false; if (user != null) { await navigationService.NavigateAsync("MainListView"); } else { UserDialogs.Instance.Alert(new AlertConfig() { Title = TextResources.Error, Message = TextResources.UserNotFound, OkText = TextResources.Ok, OnAction = () => Password = "" }); } }, () => Login.Length != 0 && Password.Length != 0 && !HasLongActivity ); SignInCommand.ObservesProperty(() => Login); SignInCommand.ObservesProperty(() => Password); SignInCommand.ObservesProperty(() => HasLongActivity); SignUpCommand = new DelegateCommand(() => navigationService.NavigateAsync("SignUpView")); }
public LoginViewModel(INavigationService navigationService, ODataClient oDataClient, HttpClient httpClient, IPageDialogService pageDialogService, ISecurityService securityService) { LoginUsingCredentionals = new DelegateCommand(async() => { try { await securityService.LoginWithCredentials(UserName, Password); await navigationService.NavigateAsync("/Nav/Main"); } catch { await pageDialogService.DisplayAlertAsync("Login failed", "Login failed", "Ok"); throw; } }, () => !string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password)); LoginUsingCredentionals.ObservesProperty(() => UserName); LoginUsingCredentionals.ObservesProperty(() => Password); LoginUsingGooglePlus = new DelegateCommand(async() => { try { await securityService.Login(new { SignInType = "Google" }); await navigationService.NavigateAsync("/Nav/Main"); } catch { await pageDialogService.DisplayAlertAsync("Login failed", "Login failed", "Ok"); throw; } }); }
private void InitSaveCommand() { SaveCommand = new DelegateCommand <object>(OnSave, CanExecuteSave); SaveCommand.ObservesProperty(() => IsNotBusy); SaveCommand.ObservesProperty(() => TableBindProp.TableName); SaveCommand.ObservesProperty(() => TableBindProp.TableSize); SaveCommand.ObservesProperty(() => TableBindProp.TableType); }
public AgregarProductoViewModel(INavigationService navigationService, IPageDialogService pageDialogService) : base(navigationService) { _pageDialogService = pageDialogService; AgregarProducto = new DelegateCommand(EjecutaAgregarProducto); AgregarProducto.ObservesProperty(() => Nombre); AgregarProducto.ObservesProperty(() => Codigo); }
public AViewModel(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; UpdateCommand = new DelegateCommand(Execute, CanExecute); UpdateCommand.ObservesProperty(() => FirstName); UpdateCommand.ObservesProperty(() => LastName); }
public MainWindowViewModel() { this.DateOfBirth = DateTime.Now; SaveCommand = new DelegateCommand(SaveCustomer, IsValidModel); SaveCommand.ObservesProperty(() => Name); SaveCommand.ObservesProperty(() => Address); SaveCommand.ObservesProperty(() => DateOfBirth); }
public ContactMePageViewModel(IPageDialogService pageDialog, INavigationService navigationService) : base(navigationService) { _pageDialog = pageDialog; SendCommand = new DelegateCommand(Send, CanSend); SendCommand.ObservesProperty(() => Email); SendCommand.ObservesProperty(() => Subject); SendCommand.ObservesProperty(() => Details); Validate(); }
private void InitAddMemberCommand() { AddMemberCommand = new DelegateCommand <object>(OnAddMember, CanAdd); AddMemberCommand.ObservesProperty(() => IsNotBusyBindProp); AddMemberCommand.ObservesProperty(() => NameMemberBindProp); AddMemberCommand.ObservesProperty(() => GenderMemberBindProp); AddMemberCommand.ObservesProperty(() => PhoneNumberMemberBindProp); AddMemberCommand.ObservesProperty(() => EmailBindProp); }
/// <summary> /// コンストラクタ /// </summary> public MainWindowViewModel() { // コマンドを定義 StartScanCommand = new DelegateCommand(ExecuteStartScanCommand, CanExecuteStartScanCommand); StartScanCommand.ObservesProperty(() => SelectedCaptureDevice); StartScanCommand.ObservesProperty(() => IsBusy); // デバイス一覧取得 DeviceList = CaptureDeviceList.Instance; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="regionManager"></param> /// <param name="eventAggregator"></param> public LoginPageViewModel(IRegionManager regionManager, IEventAggregator eventAggregator) { // インタフェースを受け取る _regionManager = regionManager; _eventAggregator = eventAggregator; // コマンドを定義 LoginCommand = new DelegateCommand(ExecuteLogin, CanExecuteLogin); LoginCommand.ObservesProperty(() => UserID); LoginCommand.ObservesProperty(() => Password); }
public EditEmployeeViewModel(IApplicationStateManager applicationStateManager, IService <Employee> employeesService, AbstractValidator <Employee> employeeValidator) { _applicationStateManager = applicationStateManager; _employeesService = employeesService; _employeeValidator = employeeValidator; PositionsNames = typeof(Positions).GetEnumNames(); SaveCommand = new DelegateCommand(OnSave, CanSave); SaveCommand.ObservesProperty(() => Name); SaveCommand.ObservesProperty(() => SelectedPosition); CancelCommand = new DelegateCommand(OnCancel); }
public ReceiptListViewModel(IReceiptRepo repo) { // Initialisierung des Repositories _repo = repo; SearchCommand = new DelegateCommand(async () => await Search()); SearchCommand.ObservesProperty(() => SearchTerm); ReceiptList = new List<Receipt> { new Receipt { Title = "Rezept 1", IsFavorit = false }, new Receipt { Title = "Rezept 2", IsFavorit = false }, new Receipt { Title = "Rezept 3", IsFavorit = true }, new Receipt { Title = "Rezept 4", IsFavorit = false } }; }
public PVViewModel(ICC cc, IEventAggregator _e) { PC = new DelegateCommand(e, c); PC.ObservesProperty(() => IC); cc.CCS.RegisterCommand(PC); ea = _e; }
public LVViewModel(ICC cc, IEventAggregator _e) { PC = new DelegateCommand(e, c); PC.ObservesProperty(() => IC); cc.CCS.RegisterCommand(PC); ea = _e; ev = ea.GetEvent <EA>(); hs(true); }
public ListAccountsPageViewModel(IConfiguration configuration) { _configuration = configuration; _bypassSslHandler = new BypassSslValidationClientHandler(); _client = new HttpClient(_bypassSslHandler); AccountTappedCommand = new DelegateCommand <object>(AccountTapped); DeleteAccountCommand = new DelegateCommand(DeleteAccount, IsAuthorizedToDeleteAccount); DeleteAccountCommand.ObservesProperty(() => IdPassportInputValue); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="regionManager"></param> /// <param name="eventAggregator"></param> public ConfigureUsersPageViewModel(IRegionManager regionManager, IEventAggregator eventAggregator) { // インタフェースを受け取る _regionManager = regionManager; _eventAggregator = eventAggregator; // コマンドを定義 CreateNewCommand = new DelegateCommand(ExecuteCreateNewCommand); UpdateCommand = new DelegateCommand(ExecuteUpdateCommand, CanExecuteUpdateCommand); UpdateCommand.ObservesProperty(() => SelectedUser); UpdateCommand.ObservesProperty(() => SelectedUser.Name); DeleteCommand = new DelegateCommand(ExecuteDeleteCommand, CanExecuteDeleteCommand); DeleteCommand.ObservesProperty(() => SelectedUser); GoBackCommand = new DelegateCommand(ExecuteGoBackCommand); RefreshUsers(); SelectedUser = new User(); }
public LoginViewModel(IRegionManager regionManager, IUserService userService, IDialogService dialogService, IMessageResourceManager messageResourceManager) { //inject login service _regionManager = regionManager; _userService = userService; _dialogService = dialogService; _messageResourceManager = messageResourceManager; LoginCommand = new DelegateCommand(Login, CanLogin); LoginCommand.ObservesProperty(() => Username); }
public MainPageViewModel(Services.INorthwindService northwindService, INavigationService navigationService) { this.northwindService = northwindService; this.navigationService = navigationService; northwindService.GetCustomersAsync() .ContinueWith(antc => this.Customers = antc.Result, System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()); addNewCommand = new DelegateCommand(AddNewCustomer); editCustomerCommand = new DelegateCommand(EditCustomer, IsCustomerAvailable); editCustomerCommand.ObservesProperty(() => this.SelectedCustomer); deleteCustomerCommand = new DelegateCommand(DeleteCustomer, IsCustomerAvailable); deleteCustomerCommand.ObservesProperty(() => this.SelectedCustomer); detailsCommand = new DelegateCommand(ShowDetails); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="regionManager"></param> /// <param name="eventAggregator"></param> public LotteryPageViewModel(IRegionManager regionManager, IEventAggregator eventAggregator) { // インタフェースを受け取る _regionManager = regionManager; _eventAggregator = eventAggregator; _eventAggregator.GetEvent <MessageSentEvent>().Subscribe(SelectedUsersReceived); // コマンドを定義 StopCommand = new DelegateCommand(ExecuteStopCommand, CanExecuteStopCommand); StopCommand.ObservesProperty(() => IsStopped); GoBackCommand = new DelegateCommand(ExecuteGoBackCommand); Result = new List <User>(SelectedUsers); // 抽選開始 Loaded(); }
public MainViewModel(ICustomersService customersService) { this.customersService = customersService; status = "Loading"; this.customersService.GetCustomersAsync() .ContinueWith(antc => Customers = antc.Result); addNewCommand = new DelegateCommand(AddNewCustomer); editCustomerCommand = new DelegateCommand <Customer>(EditCustomer, CanEditCustomer); editCustomerCommand.ObservesProperty(() => this.SelectedCustomer); deleteCustomerCommand = new DelegateCommand <Customer>(DeleteCustomer, CanDeleteCustomer); deleteCustomerCommand.ObservesProperty(() => this.SelectedCustomer); detailsCommand = new DelegateCommand <Customer>(ShowDetails); customerUpdateInteraction = new InteractionRequest <Confirmation>(); customerDetailsInteraction = new InteractionRequest <Notification>(); }
public ReceiptListViewModel(IReceiptRepo repo, INavigationService navigationService, IApiService apiService) { if (repo == null) { throw new ArgumentNullException(nameof(repo)); } // Initialisierung des Repositories _repo = repo; _navService = navigationService; _apiService = apiService; SearchCommand = new DelegateCommand(async() => await Search()); SearchCommand.ObservesProperty(() => SearchTerm); AddNewCommand = new DelegateCommand(async() => await AddNew()); EditCommand = new DelegateCommand <Receipt>(async receipt => await Edit(receipt)); }
public TrialPageViewModel(INavigationService navigationService) : base(navigationService) { _navigationService = navigationService; User = new Users(); //Validation RequestTrialCommand = new DelegateCommand(SaveTrialData, ValidateTrialData); RequestTrialCommand.ObservesProperty(() => User.CompanyName); RequestTrialCommand.ObservesProperty(() => User.Email); RequestTrialCommand.ObservesProperty(() => User.FirstName); RequestTrialCommand.ObservesProperty(() => User.LastName); RequestTrialCommand.ObservesProperty(() => User.Gender); RequestTrialCommand.ObservesProperty(() => User.PhoneNumber); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="regionManager"></param> /// <param name="eventAggregator"></param> public TopPageViewModel(IRegionManager regionManager, IEventAggregator eventAggregator) { // インタフェースを受け取る _regionManager = regionManager; _eventAggregator = eventAggregator; // コマンドを定義 AddUserToSelectedUsersCommand = new DelegateCommand(ExecuteAddUserToSelectedUsersCommand, CanExecuteAddUserToSelectedUsersCommand); AddUserToSelectedUsersCommand.ObservesProperty(() => SelectedUserInAllUsers); RemoveUserFromSelectedUsersCommand = new DelegateCommand(ExecuteRemoveUserFromSelectedUsersCommand, CanExecuteRemoveUserFromSelectedUsersCommand); RemoveUserFromSelectedUsersCommand.ObservesProperty(() => SelectedUserInSelectedUsers); StartCommand = new DelegateCommand(ExecuteStartCommand, CanExecuteStartCommand); StartCommand.ObservesProperty(() => SelectedUsers.Count); ConfigureUsersCommand = new DelegateCommand(ExecuteConfigureUsersCommand); ShowHistoriesCommand = new DelegateCommand(ExecuteShowHistoriesCommand, CanExecuteShowHistoriesCommand); ShowHistoriesCommand.ObservesProperty(() => Sessions.Count); AllUsers = UsersDataStore.GetUsers(); Sessions = SessionsDataStore.GetSessions(); }
public MyViewModel() { MyCommand = new DelegateCommand(MyCommandMethod, CanExecuteMyCommandMethod); MyCommand.ObservesProperty((() => myproperty1)); MyCommand.ObservesProperty((() => myproperty2)); }
private void InitSaveCommand() { SaveCommand = new DelegateCommand <object>(OnSave, CanExecuteSave); SaveCommand.ObservesProperty(() => IsNotBusy); SaveCommand.ObservesProperty(() => SelectedItems); }