Пример #1
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();
        }
Пример #2
0
        protected override void OnInitialize()
        {
            RefreshLists();

            _interactionManager = new InteractionManager();

            var view = GetView() as BoardListView;

            if (view == null)
            {
                return;
            }

            var scrollViewer = view.Cards.Descendants <ScrollViewer>().Cast <ScrollViewer>().SingleOrDefault();

            _interactionManager = new HoldCardInteraction(view.DragImage, view.Cards, scrollViewer);
            _interactionManager.AddInteraction(new DragVerticalInteraction(view.DragImage,
                                                                           view.Cards,
                                                                           scrollViewer,
                                                                           _events));
            _interactionManager.AddInteraction(new DragHorizontalInteraction(view.Cards,
                                                                             _events,
                                                                             PreviousId,
                                                                             NextId));
        }
Пример #3
0
        // 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();
        }
Пример #4
0
        // 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();
        }
Пример #5
0
        public YapperChatTaskPivot()
        {
            InitializeComponent();

            UserSettingsModel.Instance.LastTaskPageViewTime = DateTime.Now;
            Messenger.Default.Send <SuspendTaskCountEvent>(new SuspendTaskCountEvent()
            {
                Suspend = true
            });
            YapperChatViewModel viewModel = new YapperChatViewModel(false);

            this.DataContext = viewModel;
            PushNotification.PushNotification.Instance.Setup();
            this.TasksListSelector.ItemsSource = viewModel.Tasks.Tasks;

            this.swipeInteraction = new SwipeInteraction <MessageModel>();
            swipeInteraction.Initialize(this.TasksListSelector, itemManager, viewModel.Tasks.Tasks);

            this.tapEditInteraction = new TapEditInteraction <MessageModel>();
            tapEditInteraction.Initialize(this.TasksListSelector, itemManager, viewModel.Tasks.Tasks);
            tapEditInteraction.SaveEditText = this.SaveTaskName;

            _interactionManager.AddInteraction(swipeInteraction);
            FrameworkDispatcher.Update();

            BuildLocalizedApplicationBar();
        }
Пример #6
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (this.DataContext == null)
            {
                Guid messageId;

                messageId = Guid.Parse(NavigationContext.QueryString["clientmessageid"]);

                message = DataSync.Instance.GetMessageFromClientId(messageId);

                if (message != null)
                {
                    Messenger.Default.Register <NewMessageEvent>(this, this.MessageSavedEvent);
                    this.DataContext = message;

                    message.LoadTaskList();
                    if (message.TaskItemList != null)
                    {
                        message.TaskItemList = new ObservableSortedList <MessageModel>(message.TaskItemList, new TaskListComparer <MessageModel>());
                    }
                    else
                    {
                        message.TaskItemList = new ObservableSortedList <MessageModel>(4, new TaskListComparer <MessageModel>());
                    }

                    this.TasksListSelector.ItemsSource = message.TaskItemList;

                    dragReOrderInteraction = new DragReOrderInteraction <MessageModel>(dragImageControl);
                    dragReOrderInteraction.Initialize(this.TasksListSelector, itemManager, message.TaskItemList);

                    swipeInteraction = new SwipeInteraction <MessageModel>();
                    swipeInteraction.Initialize(this.TasksListSelector, itemManager, message.TaskItemList);

                    tapEditInteraction = new TapEditInteraction <MessageModel>();
                    tapEditInteraction.Initialize(this.TasksListSelector, itemManager, message.TaskItemList);
                    tapEditInteraction.SaveEditText = this.SaveTaskItemName;

                    //addItemInteraction = new PullDownToAddNewInteraction<MessageModel>(tapEditInteraction, pullDownItemInFront);
                    //addItemInteraction.Initialize(this.TasksListSelector, itemManager, message.TaskItemList);

                    pinchAddNewItemInteraction = new PinchAddNewInteraction <MessageModel>(tapEditInteraction, pullDownItemBehind);
                    pinchAddNewItemInteraction.Initialize(this.TasksListSelector, itemManager, message.TaskItemList);

                    _interactionManager.AddInteraction(swipeInteraction);
                    _interactionManager.AddInteraction(dragReOrderInteraction);
                    //_interactionManager.AddInteraction(addItemInteraction);
                    _interactionManager.AddInteraction(tapEditInteraction);
                    _interactionManager.AddInteraction(pinchAddNewItemInteraction);


                    if (this.message.TaskItemCount == 0)
                    {
                        MessageModel newItem = itemManager.CreateTaskMessage();
                        newItem.ItemOrder = itemManager.GetItemOrder(null, null);
                        this.message.TaskItemList.Add(newItem);
                        this.TasksListSelector.InvokeOnNextLayoutUpdated(() => this.tapEditInteraction.EditItem(newItem));
                    }

                    FrameworkDispatcher.Update();
                }
            }

            this._interactionManager.EnableInteractions();

            if (DataContext != null)
            {
                if (message.TaskItemList != null &&
                    (message.TaskItemList.Count > 0 && message.TaskItemList[0].CompareTo(pullMeDownMessage) != 0) ||
                    message.TaskItemList.Count == 0)
                {
                    //message.TaskItemList.Add(pullMeDownMessage);
                }

                this.ApplicationBar = (ApplicationBar)this.Resources["ShareTaskApplicationBar"];
            }
        }