2 // Copyright (c) Microsoft Corporation. All rights reserved.
5 namespace System.Activities.Presentation.View
7 using System.Activities.Presentation.Model;
8 using System.Collections.Generic;
11 using System.Windows.Controls;
12 using System.Windows.Input;
14 internal partial class GenericActivityTypeDesigner
16 private static AttachedProperty<string> displayNameProperty = new AttachedProperty<string>
19 OwnerType = typeof(ActivityBuilder<>),
20 Getter = (modelItem) => ViewUtilities.GetActivityBuilderDisplayName(modelItem)
23 public GenericActivityTypeDesigner()
25 this.InitializeComponent();
26 DesignerView.SetCommandMenuMode(this, CommandMenuMode.NoCommandMenu);
29 protected override void OnContextMenuLoaded(ContextMenu menu)
34 private void RegisterDisplayNameProperty()
36 AttachedPropertiesService attachedPropertiesService =
37 this.Context.Services.GetService<AttachedPropertiesService>();
38 if (attachedPropertiesService == null)
43 IEnumerable<AttachedProperty> properties = attachedPropertiesService.GetAttachedProperties(typeof(ActivityBuilder<>));
44 if (properties != null && properties.Contains(displayNameProperty))
49 attachedPropertiesService.AddProperty(displayNameProperty);