Exemplo n.º 1
0
        public async override void OnNavigatedTo(NavigationParameters parameters)
        {
            if (parameters.ContainsKey("gezin"))
            {
                gezin = (Gezin)parameters["gezin"];
            }
            await dialogService.DisplayAlertAsync("GezinsId", "" + gezin.GezinsID, "OK");

            foreach (Kleuter k in await dataConnection.LoadKleuters())
            {
                if (k.GezinsID == gezin.GezinsID)
                {
                    kleuter = k;
                }
            }
            string      fotop     = "";
            List <Foto> fotolijst = new List <Foto>();

            foreach (Foto f in await dataConnection.LoadFotos())
            {
                if (f.KleuterID == kleuter.KleuterID)
                {
                    fotolijst.Add(f);
                    fotop += f.FotoPad;
                }
            }
            Fotos = fotolijst;
        }
Exemplo n.º 2
0
        public MainPageViewModel(INavigationService navigationService, LoadAllData dataConnection)
            : base(navigationService)
        {
            Title = "Klas applicatie";
            this.dataConnection = dataConnection;

            ImageHomeClicked = new DelegateCommand(() =>
            {
                NavigationService.NavigateAsync("LogInPage");
            });

            ImageSchoolClicked = new DelegateCommand(() =>
            {
                NavigationService.NavigateAsync("FotosKleutersPage");
            });

            Kleuter k = new Kleuter
            {
                KleuterID = 0,
                VoorNaam  = "Daan",
                Naam      = "Vandebosch",
                SchoolID  = 2,
                FotoPad   = "FotoString",
                GezinsID  = 4,
                KlasID    = 4
            };

            dataConnection.SaveItemAsync(k);
            Task <List <Kleuter> > kl = dataConnection.LoadKleuters();
        }