Ejemplo n.º 1
0
        /// <remarks>
        /// ScheduledAgent constructor, initializes the UnhandledException handler
        /// </remarks>
        public ScheduledAgent()
        {
            if (!_classInitialized)
            {
                _classInitialized = true;
                // Subscribe to the managed exception handler
                Deployment.Current.Dispatcher.BeginInvoke(delegate
                {
                    Application.Current.UnhandledException += ScheduledAgent_UnhandledException;
                });
            }

            _todoManager = new TodoItemManager();
        }
Ejemplo n.º 2
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();
        }