Ejemplo n.º 1
0
        /// <summary>
        /// Default Constructor 
        /// Author: Arslan Pervaiz
        /// </summary>
        public MainPage()
        {
            InitializeComponent();

            _todoItems.Add(new ToDoItemViewModel("Item 1"));
            _todoItems.Add(new ToDoItemViewModel("Item 2"));
            _todoItems.Add(new ToDoItemViewModel("Item 3"));
            _todoItems.Add(new ToDoItemViewModel("Item 4"));
            _todoItems.Add(new ToDoItemViewModel("Item 5"));
            _todoItems.Add(new ToDoItemViewModel("Item 6"));
            _todoItems.Add(new ToDoItemViewModel("Item 7"));
            _todoItems.Add(new ToDoItemViewModel("Item 8"));
            _todoItems.Add(new ToDoItemViewModel("Item 9"));
            _todoItems.Add(new ToDoItemViewModel("Item 10"));
            _todoItems.Add(new ToDoItemViewModel("Item 11"));
            _todoItems.Add(new ToDoItemViewModel("Item 12"));
            _todoItems.Add(new ToDoItemViewModel("Item 13"));
            _todoItems.Add(new ToDoItemViewModel("Item 14"));
            _todoItems.Add(new ToDoItemViewModel("Item 15"));

            this.DataContext = _todoItems;

            var swipeInteraction = new SwipeInteraction();
            swipeInteraction.Initialise(todoList, _todoItems);
            _interactionManager.AddInteraction(swipeInteraction);
            FrameworkDispatcher.Update();
        }
Ejemplo n.º 2
0
        private void retrievingData()
        {
            ObservableCollection<ToDoItemViewModel> _todoItems = new ObservableCollection<ToDoItemViewModel>();

            using (var db = new SQLiteConnection(dbPath))
            {
                List<Person> existing = db.Query<Person>("select * from Person").ToList();
                if (existing != null)
                {
                    for (int i = 0; i < existing.Count; i++)
                    {
                        BitmapImage b = BytesToImage(existing[i].Images);
                        _todoItems.Add(new ToDoItemViewModel { Text = existing[i].Names, Text1 = existing[i].Numbers, Text2 = b, Text3 = existing[i].Id.ToString() });
                    }
                }
            }

            ContactList.DataContext = _todoItems;
            var swipeInteraction = new SwipeInteraction();
            swipeInteraction.Initialise(ContactList, _todoItems);
            _interactionManager.AddInteraction(swipeInteraction);
            FrameworkDispatcher.Update();
        }
Ejemplo n.º 3
0
        private void searchBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            //List<Person> existing = db.Query<Person>("select * from Person where Names like '%" + searchBox.Text + "%'"   ).ToList();
            ObservableCollection<ToDoItemViewModel> _todoItems = new ObservableCollection<ToDoItemViewModel>();
            using (var db = new SQLiteConnection(dbPath))
            {
                List<Person> existing = db.Query<Person>("select * from Person where Names like '%" + searchBox.Text + "%'" + "OR Numbers like " + " '%" + searchBox.Text + "%'").ToList();
                if (existing != null)
                {
                    for (int i = 0; i < existing.Count; i++)
                    {
                        BitmapImage b = BytesToImage(existing[i].Images);
                        _todoItems.Add(new ToDoItemViewModel { Text = existing[i].Names, Text1 = existing[i].Numbers, Text2 = b, Text3 = existing[i].Id.ToString() });
                    }
                }
            }

            ContactList.DataContext = _todoItems;
            var swipeInteraction = new SwipeInteraction();
            swipeInteraction.Initialise(ContactList, _todoItems);
            _interactionManager.AddInteraction(swipeInteraction);
            FrameworkDispatcher.Update();
        }
Ejemplo n.º 4
0
        private void imgFavs_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            BitmapImage bm = new BitmapImage(new Uri(@"/images/Favorite-S.png", UriKind.RelativeOrAbsolute));
            imgFavs.Source = bm;
            Grid_Fav.Visibility = Visibility.Visible;

            BitmapImage bm1 = new BitmapImage(new Uri(@"/images/NumberPad.png", UriKind.RelativeOrAbsolute));
            imgKeypad.Source = bm1;
            BitmapImage bm2 = new BitmapImage(new Uri(@"/images/ContactList.png", UriKind.RelativeOrAbsolute));
            imgContacts.Source = bm2;
            Grid_Keypad.Visibility = Visibility.Collapsed;
            Grid_Contacts.Visibility = Visibility.Collapsed;

            ObservableCollection<ToDoItemViewModel> _todoItems = new ObservableCollection<ToDoItemViewModel>();

            using (var db = new SQLiteConnection(dbPath))
            {
                List<Person> existing = db.Query<Person>("select * from Person where isFav = 1").ToList();
                if (existing != null)
                {
                    for (int i = 0; i < existing.Count; i++)
                    {
                        BitmapImage b = BytesToImage(existing[i].Images);
                        _todoItems.Add(new ToDoItemViewModel { Text = existing[i].Names, Text1 = existing[i].Numbers, Text2 = b, Text3 = existing[i].Id.ToString() });
                    }
                }
            }

            FavList.DataContext = _todoItems;
            var swipeInteraction = new SwipeInteraction();
            swipeInteraction.Initialise(FavList, _todoItems);
            _interactionManager.AddInteraction(swipeInteraction);
            FrameworkDispatcher.Update();
        }