public void Run(IBackgroundTaskInstance taskInstance)
        {
            // Get a deferral, to prevent the task from closing prematurely 
            // while asynchronous code is still running.
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();

            //load data
            _manager = new DataBakgroundManager(1);

            //start updating
            try
            {
                UpdateTile();
            }
            finally
            {
                deferral.Complete();
            }
        }
        public void Run(IBackgroundTaskInstance taskInstance)
        {
            // Get a deferral, to prevent the task from closing prematurely 
            // while asynchronous code is still running.
            BackgroundTaskDeferral deferral = taskInstance.GetDeferral();
            _manager = new DataBakgroundManager(2);

            //get date
            int day = DataManager.GetToastSnoozeValue();
            SelectedDate = DateTime.Now.Date.AddDays(day);

            //start updating
            try
            {
                SendToast();
            }
            finally
            {
                deferral.Complete();
            }
        }