예제 #1
0
 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>();
 }
예제 #2
0
        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;
        }