// Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;

            //Uri tileUri = new Uri("/MainPage.xaml?tile=flip", UriKind.Relative);
            //ShellTileData tileData = this.CreateFlipTileData();
            //ShellTile.Create(tileUri, tileData, true);


            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();

            var tileId = ShellTile.ActiveTiles.FirstOrDefault();
            if (tileId != null)
            {
                var tileData = new FlipTileData();
                tileData.BackBackgroundImage = new Uri(@" http://mywebsite/NYTraffic/Icon");
                tileData.WideBackBackgroundImage = new Uri(@" http://mywebsite/NYTraffic/IconLarge");
                var trafficTileSchedule = new ShellTileSchedule(tileId, tileData);
                trafficTileSchedule.Recurrence = UpdateRecurrence.Interval;
                trafficTileSchedule.Interval = UpdateInterval.EveryHour;
                trafficTileSchedule.Start();
            }
        }
        /// <summary>
        /// Create the application shell tile schedule instance
        /// </summary>
        private void CreateShellTileSchedule()
        {
            _shellTileSchedule = new ShellTileSchedule
            {
                Recurrence = UpdateRecurrence.Interval,
                Interval   = UpdateInterval.EveryHour,
                StartTime  = DateTime.Now
            };

            var random = new Random();

            switch (random.Next(3))
            {
            case 0:
                _shellTileSchedule.RemoteImageUri = new Uri(@"http://jvsh.ca/Tile1.png");
                break;

            case 1:
                _shellTileSchedule.RemoteImageUri = new Uri(@"http://jvsh.ca/Tile2.png");
                break;

            case 2:
                _shellTileSchedule.RemoteImageUri = new Uri(@"http://jvsh.ca/Tile3.png");
                break;

            case 3:
                _shellTileSchedule.RemoteImageUri = new Uri(@"http://jvsh.ca/Tile4.png");
                break;
            }
            _shellTileSchedule.Start();
        }
Exemple #3
0
 /// <summary>
 /// Create the application shell tile schedule instance
 /// </summary>
 private void CreateShellTileSchedule()
 {
     shellTileSchedule = new ShellTileSchedule();
     shellTileSchedule.Recurrence = UpdateRecurrence.Interval;
     shellTileSchedule.Interval = UpdateInterval.EveryHour;
     shellTileSchedule.StartTime = DateTime.Now;
     shellTileSchedule.RemoteImageUri = new Uri(@"http://cdn3.afterdawn.fi/news/small/windows-phone-7-series.png");
     shellTileSchedule.Start();
 }
Exemple #4
0
 /// <summary>
 /// Create the application shell tile schedule instance
 /// </summary>
 private void CreateShellTileSchedule()
 {
     shellTileSchedule                = new ShellTileSchedule();
     shellTileSchedule.Recurrence     = UpdateRecurrence.Interval;
     shellTileSchedule.Interval       = UpdateInterval.EveryHour;
     shellTileSchedule.StartTime      = DateTime.Now;
     shellTileSchedule.RemoteImageUri = new Uri(@"http://cdn3.afterdawn.fi/news/small/windows-phone-7-series.png");
     shellTileSchedule.Start();
 }
 private void ButtonSchedule_Click(object sender, RoutedEventArgs e)
 {
     _tileSchedule                = new ShellTileSchedule();
     _tileSchedule.Recurrence     = UpdateRecurrence.Interval;
     _tileSchedule.StartTime      = DateTime.Now;
     _tileSchedule.Interval       = UpdateInterval.EveryHour;
     _tileSchedule.RemoteImageUri = new Uri(string.Format(GetTileImageService, TileScheduleParameter));
     _tileSchedule.Start();
 }
Exemple #6
0
        private void StopACurrentSchedule()
        {
            if (mySchedule == null)
            {
                mySchedule = new ShellTileSchedule();
            }

            mySchedule.Stop();
        }
Exemple #7
0
 private void StartShellTileSchedule()
 {
     shellTileSchedule                = new ShellTileSchedule();
     shellTileSchedule.Recurrence     = UpdateRecurrence.Interval;
     shellTileSchedule.Interval       = UpdateInterval.EveryHour;
     shellTileSchedule.StartTime      = DateTime.Now;
     shellTileSchedule.RemoteImageUri =
         new Uri(@"http://apress.com/resource/bookcover/9781430232193?size=medium");
     shellTileSchedule.Start();
 }
 private void CreateShellTileSchedule()
 {
     shellTileSchedule = new ShellTileSchedule()
     {
         Recurrence = UpdateRecurrence.Interval,
         Interval = UpdateInterval.EveryHour,
         RemoteImageUri =
         new Uri(@"http://mikeo.co.uk/demo/PushNotificationImages/tile.png")
     };
     shellTileSchedule.Start();
 }
Exemple #9
0
 public void Stop()
 {
     if (_schedule == null)
     {
         // This looks crazy, I know. But unfortunately, you cannot stop a schedule that hasn't been started...
         _schedule = new ShellTileSchedule();
         _schedule.RemoteImageUri = new Uri("http://localhost/");
         _schedule.Start();
     }
     _schedule.Stop();
     _schedule = null;
 }
Exemple #10
0
 public void Start(string tileUri, UpdateInterval updateInterval)
 {
     _tileUri = tileUri;
     _updateInterval = updateInterval;
     _schedule = new ShellTileSchedule()
                        {
                            Interval = _updateInterval,
                            RemoteImageUri = new Uri(_tileUri),
                            Recurrence = UpdateRecurrence.Interval
                        };
     _schedule.StartTime = DateTime.Now;
     _schedule.Start();
 }
Exemple #11
0
        private static void EnableBackgroundWeatherCheck()
        {
            // TODO: If not first-time launch, simply return

            ShellTileSchedule tileSchedule = new ShellTileSchedule();
            bool TileScheduleRunning = false;

            // Updates will happen on a fixed interval. 
            tileSchedule.Recurrence = UpdateRecurrence.Interval;

            // Updates will happen every hour.  Because MaxUpdateCount is not set, the schedule will run indefinitely.
            tileSchedule.Interval = UpdateInterval.EveryHour;

            // TODO: fix. we need to show image based on actual weather
            tileSchedule.RemoteImageUri = new Uri("http://www.rabiajaved.com/wp-content/mystuff/Umbrella.png");
            tileSchedule.Start();
            TileScheduleRunning = true;
        }
 /// <summary> 
 /// Create the application shell tile schedule instance 
 /// </summary> 
 private void CreateShellTileSchedule()
 {
     shellTileSchedule = new ShellTileSchedule();
     shellTileSchedule.Recurrence = UpdateRecurrence.Interval;
     //shellTileSchedule.Interval = UpdateInterval.EveryDay;
     shellTileSchedule.Interval = UpdateInterval.EveryHour;
     shellTileSchedule.StartTime = DateTime.Now;
     shellTileSchedule.RemoteImageUri = new Uri(App.AppSettings.TodayKanjiImageBaseUrl + AppSettings.JLPTLevels.ToString() + ".png");
     shellTileSchedule.Start();
 }
 private void ButtonSchedule_Click(object sender, RoutedEventArgs e)
 {
     _tileSchedule = new ShellTileSchedule();
     _tileSchedule.Recurrence = UpdateRecurrence.Interval;
     _tileSchedule.StartTime = DateTime.Now;
     _tileSchedule.Interval = UpdateInterval.EveryHour;
     _tileSchedule.RemoteImageUri = new Uri(string.Format(GetTileImageService, TileScheduleParameter));
     _tileSchedule.Start();
 }
 public InstantLiveTileUpdateHelper(ShellTileSchedule schedule)
 {
     tileSchedule = schedule;
 }
 private void ScheduleTile()
 {
     _mySchedule = new ShellTileSchedule();
     _mySchedule.Recurrence = UpdateRecurrence.Onetime;
     _mySchedule.StartTime = DateTime.Now;
     _mySchedule.RemoteImageUri = new
     Uri("http://cdn3.afterdawn.fi/news/small/windows-phone-7-series.png");
     _mySchedule.Start();
 }
        private void LockScreenTileUpdate(object sender, System.EventArgs e)
        {
            ShellTile myTile = null;
            Uri iconTile;
            if(IsolatedStorageSettings.ApplicationSettings.Contains("iconTile"))
                iconTile = (Uri)IsolatedStorageSettings.ApplicationSettings["iconTile"];
            foreach (ShellTile st in ShellTile.ActiveTiles)
            {
                if (st.NavigationUri.OriginalString == "/")
                    myTile = st;
            }
            
            if (myTile != null)
            {
                IconicTileData itd = new IconicTileData();
                itd.Count = 24;

                TileSchedule = new ShellTileSchedule(myTile, itd );
                // This update will happen 1 time
                TileSchedule.Recurrence = UpdateRecurrence.Interval;
                TileSchedule.Interval = UpdateInterval.EveryHour;
                TileSchedule.MaxUpdateCount = 5;
                TileSchedule.StartTime = DateTime.Now;
                // Updates will apply to the application tile. 
                TileSchedule.Start();
            }
        }
Exemple #17
0
 public Tiles()
 {
     SampleTileSchedule = new ShellTileSchedule();
 }
Exemple #18
0
 /// <summary>
 /// Create the application shell tile schedule instance
 /// </summary>
 private void CreateShellTileSchedule()
 {
     m_ShellTileSchedule = new ShellTileSchedule();
     m_ShellTileSchedule.Recurrence = UpdateRecurrence.Interval;
     m_ShellTileSchedule.Interval = UpdateInterval.EveryHour;
     m_ShellTileSchedule.StartTime = DateTime.Now;
     m_ShellTileSchedule.RemoteImageUri = new Uri(@"http://apps.vervewireless.com/wp7/ap_tile/toppix.jpg");
     m_ShellTileSchedule.Start();
 }
Exemple #19
0
        // Code to execute when the application is launching (eg, from Start)
        // This code will not execute when the application is reactivated
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {

            ShellTileSchedule tileSchedule = new ShellTileSchedule()
            {
                Interval = UpdateInterval.EveryHour,
                RemoteImageUri = new Uri("http://www.aunder.org/xml/wp7chknews.php"),
                StartTime = DateTime.Now
            };
            InstantLiveTileUpdateHelper helper = new InstantLiveTileUpdateHelper(tileSchedule);
            helper.UpdateLiveTileAndStartSchedule("AnimeUnderground", 0);
        }
        private void ScheduleTileUpdate(object sender, System.EventArgs e)
        {
            ShellTile myTile = null;
            Uri iconTile = (Uri)IsolatedStorageSettings.ApplicationSettings["iconTile"];
            foreach(ShellTile st in ShellTile.ActiveTiles){
                if(st.NavigationUri == iconTile)
                    myTile = st;
            }
            if (myTile != null)
            {
                IconicTileData itd = new IconicTileData();

                // Set up count
                itd.Count = 30;

                // Set up text data
                itd.Title = iconicTitle.Text;
                itd.WideContent1 = iconicWideContent1.Text;
                itd.WideContent2 = iconicWideContent2.Text;
                itd.WideContent3 = iconicWideContent3.Text;

                // Set up image data
                itd.IconImage = new Uri("Assets/Tiles/Channel9_Guy_icon.png", UriKind.Relative);

                TileSchedule = new ShellTileSchedule(myTile, itd);
                // This update will happen 1 time
                TileSchedule.Recurrence = UpdateRecurrence.Onetime;
                TileSchedule.StartTime = DateTime.Now;
                // Updates will apply to the application tile. 
                TileSchedule.Start();
            }
        }