Created
September 1, 2020 09:34
-
-
Save MartinZikmund/6a9b3d0d3fdd242b6bcb5cb97c70d888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var view = item.Content; | |
if (view.Contains(StandardDataFormats.Bitmap)) | |
{ | |
var bitmapReference = await view.GetBitmapAsync(); | |
if (bitmapReference != null) | |
{ | |
var bitmap = new BitmapImage(); | |
await bitmap.SetSourceAsync(await bitmapReference.OpenReadAsync()); | |
viewer.ContentGrid.Children.Add(new Image() { Width = 300, Height = 300, Stretch = Stretch.None, Source = bitmap }); | |
} | |
} | |
else if (view.Contains(StandardDataFormats.Text)) | |
{ | |
var text = await view.GetTextAsync(); | |
if (text != null) | |
{ | |
viewer.ContentGrid.Children.Add(new TextBlock() { Text = text }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment