private void OnPinClick(object sender, EventArgs e) { if (ViewModel == null) { return; } var person = ViewModel.Person; // Download an image for the tile, // once that is done we create the tile if (person.HasEmail) { var image = new System.Windows.Media.Imaging.BitmapImage(); image.ImageOpened += delegate { var imageUri = image.SaveAsTile("Person-" + Uri.EscapeDataString(person.Id)); CreateTile(person, imageUri); }; image.ImageFailed += delegate { CreateTile(person, null); }; image.CreateOptions = System.Windows.Media.Imaging.BitmapCreateOptions.None; image.UriSource = Gravatar.GetImageUrl(person.Email, 173); } else { CreateTile(person, null); } }
private void OnPinClick (object sender, EventArgs e) { if (ViewModel == null) return; var person = ViewModel.Person; // Download an image for the tile, // once that is done we create the tile if (person.HasEmail) { var image = new System.Windows.Media.Imaging.BitmapImage (); image.ImageOpened += delegate { var imageUri = image.SaveAsTile ("Person-" + Uri.EscapeDataString (person.Id)); CreateTile (person, imageUri); }; image.ImageFailed += delegate { CreateTile (person, null); }; image.CreateOptions = System.Windows.Media.Imaging.BitmapCreateOptions.None; image.UriSource = Gravatar.GetImageUrl (person.Email, 173); } else { CreateTile (person, null); } }