Advertisement
ClusterM

WPF loading animation

Jan 15th, 2020
491
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <Window x:Class="ru.flex.Pingavator.PointLoadingWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. mc:Ignorable="d"
  7. Title="PointLoadingWindow" Height="200" Width="200"
  8. AllowsTransparency="True" WindowStyle="None" ShowInTaskbar="False">
  9. <Window.Background>
  10. <SolidColorBrush Opacity="0" Color="White"/>
  11. </Window.Background>
  12. <Grid>
  13. <Image
  14. Source="/images/spinner.png"
  15. Width="100"
  16. Height="100"
  17. RenderTransformOrigin="0.5, 0.5">
  18. <Image.Effect>
  19. <DropShadowEffect ShadowDepth="15" BlurRadius="15" RenderingBias="Performance"/>
  20. </Image.Effect>
  21. <Image.RenderTransform>
  22. <RotateTransform x:Name="noFreeze" />
  23. </Image.RenderTransform>
  24. <Image.Triggers>
  25. <EventTrigger RoutedEvent="Loaded">
  26. <BeginStoryboard>
  27. <Storyboard>
  28. <DoubleAnimation
  29. Storyboard.TargetProperty="(Image.RenderTransform).(RotateTransform.Angle)"
  30. To="360" Duration="0:0:1" RepeatBehavior="Forever" />
  31. <DoubleAnimation
  32. Storyboard.TargetProperty="(Image.Effect).(DropShadowEffect.Direction)"
  33. From="315" To="675" Duration="0:0:1" RepeatBehavior="Forever" />
  34. <DoubleAnimation
  35. Storyboard.TargetProperty="(Image.Effect).(DropShadowEffect.ShadowDepth)"
  36. From="35" To="5" Duration="0:0:2" RepeatBehavior="Forever" AutoReverse="True"/>
  37. <DoubleAnimation
  38. Storyboard.TargetProperty="(Image.Effect).(DropShadowEffect.BlurRadius)"
  39. From="30" To="5" Duration="0:0:2" RepeatBehavior="Forever" AutoReverse="True"/>
  40. <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" BeginTime="00:00:00"
  41. RepeatBehavior="Forever" AutoReverse="True">
  42. <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-15,-15,0,0" />
  43. <SplineThicknessKeyFrame KeyTime="00:00:2" Value="15,15,0,0" />
  44. </ThicknessAnimationUsingKeyFrames>
  45. </Storyboard>
  46. </BeginStoryboard>
  47. </EventTrigger>
  48. </Image.Triggers>
  49. </Image>
  50. </Grid>
  51. </Window>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement