public async void Initialize() { IfConnected(async() => { Initialized = true; _service = DependencyService.Get <IUserOverview>(); result = await _service.GetOverView(); if (!App.TokenExpired) { PickerItems.Clear(); if (result != null) { foreach (var item in result.HouseList) { PickerItems.Add(item.Name); } SelectedItem = PickerItems.First(); } } else { App.Current.MainPage = new LoginPage(); } }); }
private void AddPicker_Clicked(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(EntryPicker.Text)) { return; } PickerItems pickerItems = new PickerItems(); pickerItems.Add(Name: EntryPicker.Text); // Update picker lijst using (SQLite.SQLiteConnection connection = new SQLite.SQLiteConnection((App.DB_PATH))) { connection.CreateTable <PickerItems>(); var PickerItems = connection.Table <PickerItems>().ToList(); PickerStock.ItemsSource = PickerItems; } }