[corlib] Update ValueTuple implementation
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / VerticalConnector.xaml.cs
1 //-----------------------------------------------------------------------
2 // <copyright file="VerticalConnector.xaml.cs" company="Microsoft Corporation">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //-----------------------------------------------------------------------
6
7 namespace System.Activities.Presentation
8 {
9     using System.Activities.Presentation;
10     using System.Activities.Presentation.Hosting;
11     using System.Activities.Presentation.Model;
12     using System.Activities.Statements;
13     using System.Windows;
14     using System.Windows.Media.Animation;
15
16     internal partial class VerticalConnector
17     {
18         public VerticalConnector()
19         {
20             this.InitializeComponent();
21         }
22
23         protected override void OnDragEnter(DragEventArgs e)
24         {
25             this.CheckAnimate(e, "Expand");
26             this.dropTarget.Visibility = Visibility.Visible;
27         }
28
29         protected override void OnDragLeave(DragEventArgs e)
30         {
31             this.CheckAnimate(e, "Collapse");
32             this.dropTarget.Visibility = Visibility.Collapsed;
33         }
34
35         protected override void OnDrop(DragEventArgs e)
36         {
37             this.dropTarget.Visibility = Visibility.Collapsed;
38             base.OnDrop(e);
39         }
40
41         private void CheckAnimate(DragEventArgs e, string storyboardResourceName)
42         {
43             if (!e.Handled)
44             {
45                 BeginStoryboard((Storyboard)this.Resources[storyboardResourceName]);
46                 return;
47             }
48         }
49     }
50 }