Esempio n. 1
0
 public static void PinPage(string _FileName)
 {
     if (!PinManager.TileExists(_FileName))
     {
         ShellTile.Create(new Uri("/_Pages/_Editor.xaml?p=" + _FileName, UriKind.Relative), new FlipTileData
         {
             Title = _FileName,
             BackBackgroundImage  = new Uri("isostore:\\Shared\\ShellContent\\" + _FileName + ".jpg", UriKind.Absolute),
             BackgroundImage      = new Uri("/Images/Secondary/M.png", UriKind.Relative),
             SmallBackgroundImage = new Uri("/Images/Secondary/S.png", UriKind.Relative)
         }, false);
     }
     else
     {
         MessageBox.Show("It's already pinned.", "I can't do that.", MessageBoxButton.OK);
     }
 }
Esempio n. 2
0
        public static void DeleteFile(string Name)
        {
            if (FileExists(Name))
            {
                Files.Remove(Name);

                using (IsolatedStorageFile MyStorage = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    if (!MyStorage.FileExists("Shared/ShellContent/" + Name + ".jpg"))
                    {
                        MyStorage.DeleteFile("Shared/ShellContent/" + Name + ".jpg");
                    }
                }

                PinManager.UnPinPage(Name);
            }
        }