public void OnNavigatedTo(INavigationParameters parameters) { if (parameters.ContainsKey(nameof(Picture))) { var param = parameters[nameof(Picture)] as Picture; MyPictures.Add(param); } ; }
private void ListViewItem_MouseEnter_Sort(object sender, MouseEventArgs e) { UpdateListViewItems(); MyPictures.Clear(); SortWindow s = new SortWindow(this); s.Show(); ShutdownMode = ShutdownMode.OnLastWindowClose; }
private void paste(IEnumerable <MyPicture> newPictures) { MyPictures.Clear(); pictureLocations = new Dictionary <string, string>(); foreach (var item in newPictures) { MyPictures.Add(item); pictureLocations.Add(item.Title, item.Url.LocalPath); } }
public async void UploadAction() { string fileName = string.Format("{0}_{1}" , Guid.NewGuid() , selectedFileName); var picture = new Picture { Name = fileName , Title = PhotoTitle }; await App.MobileService.GetTable <Picture>().InsertAsync(picture); string container = "instashots"; string imageUrl = string.Format("http://{0}.blob.core.windows.net/{1}/{2}" , "splcricket" , container , fileName); StorageCredentials cred = new StorageCredentials(picture.sasQueryString); var imageUri = new Uri(picture.Imageurl); // Instantiate a Blob store container based on the info in the returned item. CloudBlobContainer cloudcontainer = new CloudBlobContainer( new Uri(string.Format("https://{0}/{1}" , imageUri.Host , container)) , cred); CloudBlockBlob blobFromSASCredential = cloudcontainer.GetBlockBlobReference(fileName); //Save File to local folder. await EditedImage.SaveToFile( ApplicationData.Current.LocalFolder, fileName, CreationCollisionOption.GenerateUniqueName); var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; var savedFile = await localFolder.GetFileAsync(fileName); using (var fileStream = await savedFile.OpenStreamForReadAsync()) { await blobFromSASCredential.UploadFromStreamAsync(fileStream.AsInputStream()); } MyPictures.Add(picture); }