Пример #1
0
        public AdicionarOfertaPageViewModel(INavigationService navigationService, IInputAlertDialogService inputAlertDialogService, IDependencyService dependencyService)
        {
            _navigationService       = navigationService;
            _inputAlertDialogService = inputAlertDialogService;

            _tipoService    = new TipoService();
            _produtoService = new ProdutoService();
            _ofertaService  = new OfertaService();

            TirarFotoCommand        = new DelegateCommand(ExecuteTirarFotoCommandAsync);
            SelecionarImagemCommand = new DelegateCommand(ExecuteSelecionarImagemCommandAsync);

            AdicionarProdutoCommand = new DelegateCommand(ExecuteAdicionarProdutoCommandAsync);
            AdicionarTipoCommand    = new DelegateCommand(ExecuteAdicionarTipoCommandAsync);

            LimparCommand = new DelegateCommand(ExecuteLimparCommand);
            SalvarCommand = new DelegateCommand(ExecuteSalvarCommandAsync);

            Tipos    = new ObservableCollection <Tipo>();
            Produtos = new ObservableCollection <Produto>();

            Sincroniza();

            DataInicioPicker = DateTime.Today;
            DataFimPicker    = DateTime.Today;

            DestaqueSwitch = false;

            IsBusy = false;
        }
        public MainPageViewModel(IInputAlertDialogService inputAlertDialogService)
        {
            _inputAlertDialogService = inputAlertDialogService;

            InputResult = "-Input Results will show up here-";

            OpenTextInputAlertDialogCommand            = new DelegateCommand(OpenTextInputAlertDialog);
            OpenCancellableTextInputAlertDialogCommand = new DelegateCommand(OpenCancellableTextInputAlertDialog);
            OpenSelectableInputAlertDialogCommand      = new DelegateCommand(OpenSelectableInputAlertDialog);
            OpenSliderInputAlertDialogCommand          = new DelegateCommand(OpenSliderInputAlertDialog);
            OpenMultipleDataInputAlertDialogCommand    = new DelegateCommand(OpenMultipleDataInputAlertDialog);
        }