Esempio n. 1
0
        //private async void Onlogoutclicked(object sender, EventArgs e)
        //{
        //    await Navigation.PopModalAsync();
        //}

        //private void ToolbarItem_Clicked(object sender, EventArgs e)
        //{
        //    DisplayAlert("Message","Under Construction","ok");
        //}
        async Task CompleteItem(TodoItem item)
        {
            item.Done = true;
            await manager.SaveTaskAsync(item);

            todoList.ItemsSource = await manager.GetTodoItemsAsync();
        }
Esempio n. 2
0
        public async void BindFromAzure()
        {
            try
            {
                syncIndicator.IsRunning = true;
                memberDatabase          = new MemberDatabase();
                // var members = memberDatabase.GetMembers();
                var sb = await manager1.GetTodoItemsAsync();

                //  var a = sb.Count();
                //   var b = members.Count();
                TextContainer.Clear();
                foreach (TodoItem var2 in sb)
                {
                    if (var2.Message.StartsWith("blobimage"))
                    {
                        int index       = var2.Message.IndexOf("blobimage");
                        var img1        = var2.Message.Substring(index + 9);
                        var imagestore2 = img1 + ".jpg";
                        var images      = DependencyService.Get <IFileService>().GetPictureFromDisk(imagestore2, getGalleryPath());
                        TextContainer.Add(new MessageText {
                            imgsource = images, imgheight = "200", imgwidth = "200", Status = var2.Status
                        });
                        var last3 = ListView.ItemsSource.Cast <object>().LastOrDefault();
                        ListView.ScrollTo(last3, ScrollToPosition.MakeVisible, false);
                    }

                    else if (var2.Message.StartsWith("pdf"))
                    {
                        int index       = var2.Message.IndexOf("pdf");
                        var img1        = var2.Message.Substring(index + 3);
                        var imagestore2 = img1 + ".pdf";
                        var pdffile     = DependencyService.Get <IFileService>().GetPictureFromDisk(imagestore2, getGalleryPath());
                        //  TextContainer.Add(new MessageText { imgsource = images, imgheight = "200", imgwidth = "200", Status = var2.Status });
                        TextContainer.Add(new MessageText {
                            Text = pdffile, imgheight = "10", imgwidth = "10", Status = var2.Status
                        });

                        var last3 = ListView.ItemsSource.Cast <object>().LastOrDefault();
                        ListView.ScrollTo(last3, ScrollToPosition.MakeVisible, false);
                    }

                    else
                    {
                        TextContainer.Add(new MessageText {
                            Text = var2.Message, imgheight = "10", imgwidth = "10", Status = var2.Status
                        });
                        var last3 = ListView.ItemsSource.Cast <object>().LastOrDefault();
                        ListView.ScrollTo(last3, ScrollToPosition.MakeVisible, false);
                    }
                }

                syncIndicator.IsRunning = false;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                syncIndicator.IsRunning = false;
            }
        }
Esempio n. 3
0
        private async void Query(string idBuscar)
        {
            //li_nom.ItemsSource = await manager.GetTodoItemsAsync(idBuscar);
            Collection <UsersUPT> s = new Collection <UsersUPT>();

            s = await manager.GetTodoItemsAsync(idBuscar);

            Debug.WriteLine(s[0].PID + "/" + s[0].nombre + "/" + s[0].edad + "/" + s[0].descripcion);
            labelNom.Text  = s[0].nombre;
            labelAge.Text  = s[0].edad.ToString();
            labelDesc.Text = s[0].descripcion;
        }
Esempio n. 4
0
        private async Task LoadItems()
        {
            IEnumerable <TodoItem> items = await manager.GetTodoItemsAsync();

            TodoItems = new ObservableCollection <TodoItemViewModel>();

            foreach (var i in items)
            {
                TodoItems.Add(await TodoItemViewModel.CreateAsync(i, this.manager));
                Debug.WriteLine("Created view model for: " + i.Name);
            }
        }
Esempio n. 5
0
 private async void Query(string idBuscar)
 {
     li_nom.ItemsSource = await manager.GetTodoItemsAsync(idBuscar);
 }