Using the Media Image package
The Media Image package is designed to be used in applications that require image processing.
Loading StorageFile thumbnails into an Image with LoadStorageFileThumbnailImageBehavior
The MADE.Media.Image.Behaviors.LoadStorageFileThumbnailImageBehavior
is a custom behavior built on the Microsoft XAML behaviors SDK.
It can be attached to an Image
UI element and used to load the thumbnail of a StorageFile
.
You can do this in your app XAML as shown below.
<Page
x:Class="App.Media.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:behaviors="using:MADE.Media.Image.Behaviors"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<RelativePanel Padding="12">
<Image>
<interactivity:Interaction.Behaviors>
<behaviors:LoadStorageFileThumbnailImageBehavior File="{x:Bind ViewModel.ImageFile}" />
</interactivity:Interaction.Behaviors>
</Image>
</RelativePanel>
</Page>
This could result in a generated UI that looks like this.