1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
5 namespace System
.Activities
.Core
.Presentation
7 using System
.Activities
.Presentation
;
8 using System
.Activities
.Presentation
.Hosting
;
10 using System
.Windows
.Automation
;
11 using System
.Windows
.Media
.Animation
;
13 partial class ParallelSeparator
15 public static readonly DependencyProperty AllowedItemTypeProperty
=
16 DependencyProperty
.Register("AllowedItemType", typeof(Type
), typeof(ParallelSeparator
), new UIPropertyMetadata(typeof(object)));
18 public static readonly DependencyProperty ContextProperty
= DependencyProperty
.Register(
20 typeof(EditingContext
),
21 typeof(ParallelSeparator
));
23 public ParallelSeparator()
25 this.InitializeComponent();
26 if (!LocalAppContextSwitches
.UseLegacyAccessibilityFeatures
)
28 SetValue(AutomationProperties
.NameProperty
, SR
.ParallelSeparatorAutomationName
);
32 public Type AllowedItemType
34 get { return (Type)GetValue(AllowedItemTypeProperty); }
35 set { SetValue(AllowedItemTypeProperty, value); }
38 public EditingContext Context
40 get { return (EditingContext)GetValue(ContextProperty); }
41 set { SetValue(ContextProperty, value); }
44 protected override void OnDragEnter(DragEventArgs e
)
46 CheckAnimate(e
, "Expand");
47 this.dropTarget
.Visibility
= Visibility
.Visible
;
50 protected override void OnDragLeave(DragEventArgs e
)
52 CheckAnimate(e
, "Collapse");
53 this.dropTarget
.Visibility
= Visibility
.Collapsed
;
56 protected override void OnDrop(DragEventArgs e
)
58 this.dropTarget
.Visibility
= Visibility
.Collapsed
;
62 void CheckAnimate(DragEventArgs e
, string storyboardResourceName
)
66 if (!this.Context
.Items
.GetValue
<ReadOnlyState
>().IsReadOnly
&&
67 DragDropHelper
.AllowDrop(e
.Data
, this.Context
, this.AllowedItemType
))
69 BeginStoryboard((Storyboard
)this.Resources
[storyboardResourceName
]);
74 e
.Effects
= DragDropEffects
.None
;