Beispiel #1
0
        public sozdkr(vis_an_dohod element)
        {
            InitializeComponent();

            this.id_dohoda = element.id;
            categoria      = element;

            string dbPath = DependencyService.Get <ISQLite>().GetDatabasePath("friends.db");
            var    db     = new SQLiteConnection(dbPath);



            var an_categ_list = db.Query <an_dohod>("SELECT * " +
                                                    "FROM [an_dohod] ");

            int ind_categ = an_categ_list.FindIndex(x => x.id == element.id);

            picker_categ.ItemsSource   = an_categ_list;
            picker_categ.SelectedIndex = ind_categ;

            var an_purse_list = db.Query <an_purse>("SELECT * " +
                                                    "FROM [an_purse] ");

            // int ind_purse = an_purse_list.FindIndex(x => x.id == element.ku);
            picker_purse.ItemsSource   = an_purse_list;
            picker_purse.SelectedIndex = 0;
        }
Beispiel #2
0
        async void OnSelection(object sender, ItemTappedEventArgs e)
        {
            if (e.Item == null)
            {
                return; //ItemSelected is called on deselection, which results in SelectedItem being set to null
            }
            //  DisplayAlert("Item Selected", (e.SelectedItem as an_dohod).komment.ToString(), "Ok");


            vis_an_dohod element    = (e.Item as vis_an_dohod);
            var          detailPage = new sozdkr(element);
            await Navigation.PushAsync(detailPage);



            //((ListView)sender).SelectedItem = null; //uncomment line if you want to disable the visual selection state.
        }