예제 #1
0
        public void SetProperty(AttachedPropertyID propertyID, object value)
        {
            var dictionary = _data.Value;

            lock (dictionary) {
                dictionary[propertyID] = value;
            }
        }
예제 #2
0
 public bool RemoveProperty(AttachedPropertyID propertyID)
 {
     if (_data.IsValueCreated)
     {
         var dictionary = _data.Value;
         lock (dictionary) {
             return(dictionary.Remove(propertyID));
         }
     }
     return(false);
 }
예제 #3
0
        public bool TryGetProperty(AttachedPropertyID propertyID, out object value)
        {
            if (_data.IsValueCreated)
            {
                var dictionary = _data.Value;

                lock (dictionary) {
                    object answer;

                    if (dictionary.TryGetValue(propertyID, out answer))
                    {
                        value = answer;
                        return(true);
                    }
                }
            }

            value = null;
            return(false);
        }
예제 #4
0
 public static string GetExtenderName(AttachedPropertyID name)
 {
     return(string.Concat(name.DeclaringType.Name, ".", name.PropertyName));
 }
 public abstract bool TryGetProperty(AttachedPropertyID propertyID, out object value);
 public abstract void SetProperty(AttachedPropertyID propertyID, object value);
 public abstract bool RemoveProperty(AttachedPropertyID propertyID);