private async void appBarButton_Click(object sender, EventArgs e)
        {
            // Get a list of selected images
            List <FlickrImage> imgs = new List <FlickrImage>();

            foreach (object item in PhotosForLockscreen.SelectedItems)
            {
                FlickrImage img = item as FlickrImage;

                if (img != null)
                {
                    imgs.Add(img);
                }
            }

            // Clean out / remove all images currently in IsolatedStorage
            LockScreenHelpers.CleanStorage();

            // Save this new list of selected images to IsolatedStorage
            LockScreenHelpers.SaveSelectedBackgroundScreens(imgs);

            // Randomly select one item and set it as the lockscreen
            await LockScreenHelpers.SetRandomImageFromLocalStorage();

            // Test by hitting F12 twice in the emulator

            MessageBox.Show("You have a new background!", "Set!", MessageBoxButton.OK);
        }
예제 #2
0
        async void appBarButton_Click(object sender, EventArgs e)
        {
            List <FlikrImage> imgs = new List <FlikrImage>();

            foreach (object item in PhotosForLockScreen.SelectedItems)
            {
                FlikrImage img = item as FlikrImage;
                if (img != null)
                {
                    imgs.Add(img);
                }
            }
            //Clean out aall images in isolated storage
            LockScreenHelpers.CleanStorage();

            //Save this new list in isolated storage
            LockScreenHelpers.SaveSelectedBackgroundScreens(imgs);

            //Randomly select one item and use it as lockscreen
            await LockScreenHelpers.SetRandomImageFormLocalStorage();


            MessageBox.Show("You have a new lockscreen image", "Set!", MessageBoxButton.OK);
        }