Skip to content

Instantly share code, notes, and snippets.

@karno
Created December 12, 2010 04:04
Show Gist options
  • Save karno/737829 to your computer and use it in GitHub Desktop.
Save karno/737829 to your computer and use it in GitHub Desktop.
Show images with stacking
<UserControl x:Class="EroTool.View.UserCtl.ImageStackView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300"
d:DesignWidth="300">
<UserControl.Resources>
<!-- You can set a picture which shows during loading images. -->
<BitmapImage x:Key="LoadingBig" UriSource="../../Resources/loading_big.png" />
</UserControl.Resources>
<Grid>
<Viewbox>
<Grid Name="Stacker" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Viewbox>
<Image Source="{StaticResource LoadingBig}" Stretch="None" RenderTransformOrigin="0.5, 0.5" Name="LoadingAnimation">
<Image.RenderTransform>
<RotateTransform Angle="0"/>
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Image.Loaded">
<BeginStoryboard Name="Rotate">
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.Angle" From="0" To="360"
Duration="0:0:1.5" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</Grid>
</UserControl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment