Пример #1
0
        public LogViewModel(INavigator navigator,
                            IBaseService <Logg> logService,
                            IFileManager fileManager,
                            IHuntFactory huntFactory,
                            ICustomFieldFactory fieldFactory,
                            IMediaService mediaService)
        {
            _navigator    = navigator;
            _logService   = logService;
            _fileManager  = fileManager;
            _huntFactory  = huntFactory;
            _fieldFactory = fieldFactory;
            MediaService  = mediaService;

            ItemTappedCommand = new Command(async() => await ShowItem());
            SaveCommand       = new Command(async() => await Save());
            DeleteCommand     = new Command(async() => await Delete());
            CancelCommand     = new Command(async() => { await _navigator.PopAsync(); });

            TimeCommand     = new Command(async() => { await EditDateFrom(); });
            NoSpecieCommand = new Command(async() => { await _navigator.PushAsync <SpeciesViewModel>(); });
            HunterAndDog    = new ObservableCollection <PickerItem>();
            CustomFields    = new List <CustomFieldViewModel>();

            CreateImageActions();
            CreatePositionActions();
        }
Пример #2
0
        public HuntersViewModel(IBaseService <Jeger> hunterService, INavigator navigator, Func <HunterViewModel> hunterViewModelFactory, IHuntFactory huntFactory)
        {
            _hunterService          = hunterService;
            _navigator              = navigator;
            _hunterViewModelFactory = hunterViewModelFactory;
            _huntFactory            = huntFactory;

            AddCommand        = new Command(async() => await AddItem());
            DeleteItemCommand = new Command(async(item) => await DeleteItem(item));

            IsBusy = true;
        }
Пример #3
0
        public LogListItemViewModel(INavigator navigator,
                                    IHuntFactory huntFactory,
                                    IBaseService <Logg> logService,
                                    IBaseService <Jakt> huntService)
        {
            _navigator   = navigator;
            _huntFactory = huntFactory;
            _logService  = logService;
            _huntService = huntService;

            ItemTappedCommand = new Command(async() => { await ShowItem(); });
        }
Пример #4
0
        public CustomFieldViewModel(IBaseService <LoggType> customFieldService, INavigator navigator, ISelectService <LoggType> selectService, IHuntFactory huntFactory)
        {
            _customFieldService = customFieldService;
            _navigator          = navigator;
            _selectService      = selectService;
            _huntFactory        = huntFactory;

            //SaveCommand = new Command(async () => await Save());
            //DeleteCommand = new Command(async () => await Delete());
            ItemTappedCommand = new Command(async() => await Tapped());
            CancelCommand     = new Command(async() => { await PopAsync(); });
        }
Пример #5
0
        public DogsViewModel(IBaseService <Dog> dogService, INavigator navigator, Func <DogViewModel> dogViewModelFactory, IHuntFactory huntFactory)
        {
            _dogService          = dogService;
            _navigator           = navigator;
            _dogViewModelFactory = dogViewModelFactory;
            _huntFactory         = huntFactory;

            AddCommand        = new Command(async() => await AddItem());
            DeleteItemCommand = new Command(async(item) => await DeleteItem(item));

            IsBusy = true;
        }
Пример #6
0
        public DogViewModel(IBaseService <Dog> dogService, INavigator navigator, IFileManager fileManager, IHuntFactory huntFactory)
        {
            _dogService  = dogService;
            _navigator   = navigator;
            _fileManager = fileManager;
            _huntFactory = huntFactory;

            SaveCommand       = new Command(async() => await Save());
            DeleteCommand     = new Command(async() => await Delete());
            ItemTappedCommand = new Command(async() => await Tapped());
            CancelCommand     = new Command(async() => { await PopAsync(); });

            CreateImageActions();
        }
Пример #7
0
        public SpecieViewModel(IBaseService <Art> specieService, INavigator navigator, ISelectService <Art> selectService, IHuntFactory huntFactory)
        {
            _specieService = specieService;
            _navigator     = navigator;
            _selectService = selectService;
            _huntFactory   = huntFactory;

            //SaveCommand = new Command(async () => await Save());
            //DeleteCommand = new Command(async () => await Delete());
            ItemTappedCommand = new Command(async() => await Tapped());
            CancelCommand     = new Command(async() => { await PopAsync(); });

            CreateImageActions();
        }
Пример #8
0
        public StatsMapViewModel(StatsFilterViewModel statsFilterViewModel,
                                 IHuntFactory huntFactory,
                                 IBaseService <Logg> logService)
        {
            _huntFactory         = huntFactory;
            _logService          = logService;
            StatsFilterViewModel = statsFilterViewModel;

            StatsFilterViewModel.FilterChangedAction += async() =>
            {
                await AddPins();

                ZoomToShowAllPins();
            };
        }
Пример #9
0
 public HuntsViewModel(IBaseService <Jakt> huntService,
                       Func <HuntListItemViewModel> huntListItemViewModelFactory,
                       INavigator navigator,
                       IHuntFactory huntFactory,
                       IDialogService dialogService)
 {
     _huntService = huntService;
     _huntListItemViewModelFactory = huntListItemViewModelFactory;
     _navigator             = navigator;
     _huntFactory           = huntFactory;
     _dialogService         = dialogService;
     HuntListItemViewModels = new ObservableCollection <HuntGroup>();
     AddCommand             = new Command(async() => await AddItem());
     DeleteItemCommand      = new Command(async(args) => await DeleteItem(args));
     RefreshCommand         = new Command(async() => await FetchData(true));
 }
Пример #10
0
        public SpeciesViewModel(IBaseService <Art> specieService,
                                IBaseService <ArtGroup> specieGroupService,
                                ISelectService <Art> selectService,
                                INavigator navigator,
                                Func <SpecieViewModel> specieViewModelFactory,
                                IHuntFactory huntFactory)
        {
            _specieService          = specieService;
            _specieGroupService     = specieGroupService;
            _selectService          = selectService;
            _navigator              = navigator;
            _specieViewModelFactory = specieViewModelFactory;
            _huntFactory            = huntFactory;

            AddCommand = new Command(async() => await AddItem());
            //DeleteItemCommand = new Command(async (item) => await DeleteItem(item));
        }
Пример #11
0
        public EditHuntViewModel(IBaseService <Jakt> huntService,
                                 IBaseService <Jeger> hunterService,
                                 INavigator navigator,
                                 IDialogService dialogService,
                                 IFileManager fileManager,
                                 IHuntFactory hunterFactory)
        {
            _huntService   = huntService;
            _hunterService = hunterService;
            _navigator     = navigator;
            _dialogService = dialogService;
            _fileManager   = fileManager;
            _huntFactory   = hunterFactory;

            SaveCommand   = new Command(async() => await Save());
            DeleteCommand = new Command(async() => await Delete());
            CancelCommand = new Command(async() => { await _navigator.PopAsync(); });

            DateFromCommand   = new Command(async() => await EditDateFrom());
            DateToCommand     = new Command(async() => await EditDateTo());
            AddHuntersCommand = new Command(async() => {
                await _navigator.PushAsync <HuntersViewModel>(beforeNavigate: (arg) => {
                    arg.Callback = () =>
                    {
                        GetHunters();
                    };
                });
            });
            AddDogsCommand = new Command(async() => {
                await _navigator.PushAsync <DogsViewModel>(beforeNavigate: (arg) => {
                    arg.Callback = () =>
                    {
                        GetDogs();
                    };
                });
            });

            CreateImageActions();
            CreatePositionActions();
        }
Пример #12
0
        public HuntViewModel(IBaseService <Jeger> hunterService,
                             INavigator navigator,
                             IBaseService <Logg> logService,
                             Func <LogListItemViewModel> logItemViewModelFactory,
                             IHuntFactory huntFactory)
        {
            _hunterService = hunterService;
            _logService    = logService;
            _navigator     = navigator;
            _logListItemViewModelFactory = logItemViewModelFactory;
            _huntFactory = huntFactory;


            EditCommand           = new Command(async() => await EditItem());
            AddCommand            = new Command(async() => await AddItem());
            MapCommand            = new Command(async() => await ShowMap());
            RefreshCommand        = new Command(async() => await FetchData());
            DeleteItemCommand     = new Command(async(args) => await DeleteItem(args));
            LogListItemViewModels = new ObservableCollection <LogGroup>();

            IsBusy = true;
        }
Пример #13
0
        public StatsFilterViewModel(INavigator navigator, IHuntFactory huntFactory)
        {
            _huntFactory = huntFactory;
            _navigator   = navigator;

            DateRangeCommand = new Command((obj) =>
            {
                SetDate(obj);
                FilterChangedAction?.Invoke();
            });

            FilterCommand = new Command(() =>
            {
                Visible = !Visible;
            });

            FilterHunterCommand = new Command(async() => {
                var selected = new List <string>();
                if (SelectedHunter != null)
                {
                    selected.Add(SelectedHunter.ID);
                }
                var hunterItems = await _huntFactory.CreateHunterPickerItems(selected);

                await _navigator.PushAsync <InputPickerViewModel>(
                    afterNavigate: async(arg) => await arg.InitializeAsync(
                        value: hunterItems,
                        completeAction: (obj) => {
                    SelectedHunter = obj?.FirstOrDefault(x => x.Selected);
                    FilterChangedAction?.Invoke();
                }
                        )
                    );
            });

            SetDate("Alle");
        }