1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 //----------------------------------------------------------------
5 namespace System.Activities.Presentation.Model
7 using System.Activities.Presentation;
9 public abstract class AttachedPropertyInfo
11 bool isBrowsable = true;
12 bool? isVisibleToModelItem;
14 public string PropertyName { get; set; }
16 internal bool IsBrowsable
18 get { return isBrowsable; }
19 set { this.isBrowsable = value; }
22 internal bool IsVisibleToModelItem
24 get { return this.isVisibleToModelItem.HasValue ? this.isVisibleToModelItem.Value : this.isBrowsable; }
25 set { this.isVisibleToModelItem = value; }
28 internal abstract void Register(ViewStateAttachedPropertyFeature viewStateAttachedPropertyFeature);
31 public sealed class AttachedPropertyInfo<T> : AttachedPropertyInfo
33 public T DefaultValue { get; set; }
35 internal override void Register(ViewStateAttachedPropertyFeature viewStateAttachedPropertyFeature)
37 viewStateAttachedPropertyFeature.RegisterAttachedProperty<T>(this.PropertyName, this.IsBrowsable, this.IsVisibleToModelItem, this.DefaultValue);