You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
3.8 KiB
51 lines
3.8 KiB
<local:DragDropAdornerBase x:Class="Gumming.ImageDragDropAdorner"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="clr-namespace:Gumming"
|
|
Height="100" Width="100">
|
|
<UserControl.Resources>
|
|
<Storyboard x:Key="canDrop" FillBehavior="Stop">
|
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
|
|
<SplineDoubleKeyFrame KeySpline="0.709,0,0.689,1" KeyTime="00:00:00.1000000" Value="1.1"/>
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
|
|
</DoubleAnimationUsingKeyFrames>
|
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
|
|
<SplineDoubleKeyFrame KeySpline="0.709,0,0.689,1" KeyTime="00:00:00.1000000" Value="1.1"/>
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
|
|
</DoubleAnimationUsingKeyFrames>
|
|
<DoubleAnimation Storyboard.TargetProperty="(UIElement.Opacity)" To="0" BeginTime="00:00:00" Duration="00:00:00.3" />
|
|
</Storyboard>
|
|
<Storyboard x:Key="cannotDrop" FillBehavior="Stop">
|
|
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:00.25" AccelerationRatio=".1" DecelerationRatio=".9" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" />
|
|
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:00.25" AccelerationRatio=".1" DecelerationRatio=".9" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" />
|
|
<DoubleAnimation Storyboard.TargetProperty="(UIElement.Opacity)" To="0" BeginTime="00:00:00.15" Duration="00:00:00.2" />
|
|
</Storyboard>
|
|
<Storyboard x:Key="loadAni">
|
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.3"/>
|
|
<SplineDoubleKeyFrame KeySpline="0.709,0,0.689,1" KeyTime="00:00:00.1000000" Value="1.1"/>
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
|
|
</DoubleAnimationUsingKeyFrames>
|
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.3"/>
|
|
<SplineDoubleKeyFrame KeySpline="0.709,0,0.689,1" KeyTime="00:00:00.1000000" Value="1.1"/>
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
|
|
</DoubleAnimationUsingKeyFrames>
|
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
|
<SplineDoubleKeyFrame KeySpline="0.709,0,0.689,1" KeyTime="00:00:00.1000000" Value="1"/>
|
|
</DoubleAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</UserControl.Resources>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height=".8*"/>
|
|
<RowDefinition Height=".2*"/>
|
|
</Grid.RowDefinitions>
|
|
<Image Source="{Binding ImageSource}"/>
|
|
<TextBlock Grid.Row="1" Text="{Binding ImageName}" HorizontalAlignment="Center"/>
|
|
</Grid>
|
|
</local:DragDropAdornerBase>
|