private void number_TextChanged(object sender, TextChangedEventArgs e) { ObservableCollection <ToDoItemViewModel> _todoItems = new ObservableCollection <ToDoItemViewModel>(); using (var db = new SQLiteConnection(dbPath)) { List <Person> existing = db.Query <Person>("select * from Person where Names like '%" + number.Text + "%'" + "OR Numbers like " + " '%" + number.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() }); } } } SearchedContactList.DataContext = _todoItems; var swipeInteraction = new SwipeInteraction(); swipeInteraction.Initialise(SearchedContactList, _todoItems); _interactionManager.AddInteraction(swipeInteraction); FrameworkDispatcher.Update(); }
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(); }
// Constructor public MainPage() { InitializeComponent(); this.DataContext = _viewModel.Items; var dragReOrderInteraction = new DragReOrderInteraction(dragImageControl); dragReOrderInteraction.Initialise(todoList, _viewModel.Items); var swipeInteraction = new SwipeInteraction(); swipeInteraction.Initialise(todoList, _viewModel.Items); var tapEditInteraction = new TapEditInteraction(); tapEditInteraction.Initialise(todoList, _viewModel.Items); var addItemInteraction = new PullDownToAddNewInteraction(tapEditInteraction, pullDownItemInFront); addItemInteraction.Initialise(todoList, _viewModel.Items); _pinchAddNewItemInteraction = new PinchAddNewInteraction(tapEditInteraction, pullDownItemBehind); _pinchAddNewItemInteraction.Initialise(todoList, _viewModel.Items); _interactionManager.AddInteraction(swipeInteraction); _interactionManager.AddInteraction(dragReOrderInteraction); _interactionManager.AddInteraction(addItemInteraction); _interactionManager.AddInteraction(tapEditInteraction); _interactionManager.AddInteraction(_pinchAddNewItemInteraction); FrameworkDispatcher.Update(); }
// Constructor public MainPage() { InitializeComponent(); _viewModel.Items.Add(new ToDoItemViewModel("Feed the cat")); _viewModel.Items.Add(new ToDoItemViewModel("Buy eggs")); _viewModel.Items.Add(new ToDoItemViewModel("Pack bags for WWDC conference")); _viewModel.Items.Add(new ToDoItemViewModel("Rule the web")); _viewModel.Items.Add(new ToDoItemViewModel("Order business cards")); _viewModel.Items.Add(new ToDoItemViewModel("Fix laptop")); _viewModel.Items.Add(new ToDoItemViewModel("Get some dollars for trip")); _viewModel.Items.Add(new ToDoItemViewModel("Shirts")); _viewModel.Items.Add(new ToDoItemViewModel("Shopping")); _viewModel.Items.Add(new ToDoItemViewModel("Contact PR company")); _viewModel.Items.Add(new ToDoItemViewModel("Extension plans")); _viewModel.Items.Add(new ToDoItemViewModel("Choose colour scheme")); _viewModel.Items.Add(new ToDoItemViewModel("Create new website")); _viewModel.Items.Add(new ToDoItemViewModel("Write-up blog post")); _viewModel.Items.Add(new ToDoItemViewModel("Choose life")); _viewModel.Items.Add(new ToDoItemViewModel("Simplify my life")); this.DataContext = _viewModel.Items; var dragReOrderInteraction = new DragReOrderInteraction(dragImageControl); dragReOrderInteraction.Initialise(todoList, _viewModel.Items); var swipeInteraction = new SwipeInteraction(); swipeInteraction.Initialise(todoList, _viewModel.Items); var tapEditInteraction = new TapEditInteraction(); tapEditInteraction.Initialise(todoList, _viewModel.Items); var addItemInteraction = new PullDownToAddNewInteraction(tapEditInteraction, pullDownItemInFront); addItemInteraction.Initialise(todoList, _viewModel.Items); var pinchAddNewItemInteraction = new PinchAddNewInteraction(tapEditInteraction, pullDownItemBehind); pinchAddNewItemInteraction.Initialise(todoList, _viewModel.Items); _interactionManager.AddInteraction(swipeInteraction); _interactionManager.AddInteraction(dragReOrderInteraction); _interactionManager.AddInteraction(addItemInteraction); _interactionManager.AddInteraction(tapEditInteraction); _interactionManager.AddInteraction(pinchAddNewItemInteraction); FrameworkDispatcher.Update(); }
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(); }