public DetalhesEmprestimoViewModel() { servicoArmazenamento = DependencyService.Get <IArmazenamentoService>(); listaEmprestimo = servicoArmazenamento.ResgatarListaEmprestimo(); OnAppearingCommand = new Command(() => NoAparecimento()); DevolverCommand = new Command(async() => await Devolver()); RemoverCommand = new Command(async() => await Remover()); CancelarCommand = new Command(async() => await App.navigationPage.PopAsync()); ListaEmprestimo = new ObservableCollection <ItemEmprestimoDao>(); }
public ListaTelefonesViewModel() { servicoArmazenamento = DependencyService.Get <IArmazenamentoService>(); servicoLeitorQr = DependencyService.Get <ILeitorQrService>(); OnAppearingCommand = new Command(() => NoAparecimento()); AbrirConfiguracaoCommand = new Command(async() => await AbrirConfiguracao()); AbrirAjudaCommand = new Command(async() => await App.navigationPage.PushAsync(new PaginaAjuda())); DetalhesEmprestimoCommand = new Command <ItemEmprestimoDao>(async(telefone) => await IrParaDetalhesEmprestimo(telefone)); EmprestarDevolverCommand = new Command(async() => await EmprestarDevolver()); ListaTelefone = new ObservableCollection <ItemEmprestimoDao>(); MessagingCenter.Subscribe <string>(this, "Update", (sender) => { NoAparecimento(); }); }
public AdicionarEmprestimoViewModel(ItemEmprestimo itemEncontrado) { ItemEncontrado = itemEncontrado; servicoArmazenamento = DependencyService.Get <IArmazenamentoService>(); ListaTelefones = new ObservableCollection <ItemEmprestimo>(); ListaEmprestador = new ObservableCollection <Emprestador>(); OnAppearingCommand = new Command(() => NoAparecimento()); AdicionarDevolverEmprestimoCommand = new Command(async() => await AdicionarDevolverEmprestimo()); VoltarTelaDeEmprestimoCommand = new Command(async() => await App.navigationPage.PopAsync()); ListaHistoricoTelefone = servicoArmazenamento.ResgatarListaEmprestimo(); listaItens = servicoArmazenamento.ResgatarListaItens(); listaEmprestador = servicoArmazenamento.ResgatarListaEmprestador(); Devolucao = itemEncontrado.Devolucao; }
public ConfiguracaoViewModel() { servicoArmazenamento = DependencyService.Get <IArmazenamentoService>(); ItensAtivoCommand = new Command(() => AtivarItens()); UsuariosAtivoCommand = new Command(() => AtivarUsuarios()); VoltarCommand = new Command(async() => await App.navigationPage.PopAsync()); OnAppearingCommand = new Command(() => NoAparecimento()); CadastrarCommand = new Command(() => Cadastrar()); CopiarItemCommand = new Command <ItemEmprestimo>(async(x) => await CopiarItem(x)); RemoverItemCommand = new Command <ItemEmprestimo>((x) => RemoverItem(x)); RemoverEmprestadorCommand = new Command <Emprestador>((x) => RemoverEmprestador(x)); ListaEmprestador = new ObservableCollection <Emprestador>(); ListaItemEmprestimo = new ObservableCollection <ItemEmprestimo>(); listaEmprestador = servicoArmazenamento.ResgatarListaEmprestador(); listaItemEmprestimo = servicoArmazenamento.ResgatarListaItens(); ItensAtivo = true; }