public PinchAddNewInteraction(TapEditInteraction editInteraction, PullDownItem pullDownItem)
        {
            _editInteraction = editInteraction;
            _pullDownItem = pullDownItem;

            _popSound = SoundEffect.FromStream(Microsoft.Xna.Framework.TitleContainer.OpenStream("Sounds/pop.wav"));
        }
Esempio n. 2
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();
        }
Esempio n. 3
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();
        }
Esempio n. 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();
        }
Esempio n. 5
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();
        }
Esempio n. 6
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();
        }
Esempio n. 7
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            _todoManager = new TodoItemManager();

            _viewModel.Update(_todoManager.GetTodos());

            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);

            periodicTaskName = "ClearStyleTilePeriodicAgent";

            StartPeriodicAgent();

            FrameworkDispatcher.Update();
        }
Esempio n. 8
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"];
            }
        }
Esempio n. 9
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"];
            }
        }