コード例 #1
0
        private void CreateTiles()
        {
            IsolatedStorageSettings applicationSettings = IsolatedStorageSettings.get_ApplicationSettings();

            try
            {
                if (Enumerable.FirstOrDefault <ShellTile>(ShellTile.get_ActiveTiles()) != null)
                {
                    FlipTileData flipTileDatum = new FlipTileData();
                    flipTileDatum.set_BackgroundImage(new Uri("/Assets/Tiles/iconapp21.png", 2));
                    flipTileDatum.set_Title("Tivi Việt Free");
                    flipTileDatum.set_WideBackgroundImage(new Uri("/Assets/Tiles/logofull.png", 2));
                    ShellTile.Create(new Uri("/MainPage.xaml", 2), flipTileDatum, false);
                    if (applicationSettings.Contains("Zipcodes"))
                    {
                        applicationSettings.set_Item("Zipcodes", "titles");
                    }
                    else
                    {
                        applicationSettings.Add("Zipcodes", "titles");
                    }
                    applicationSettings.Save();
                }
            }
            catch (Exception exception)
            {
            }
        }