Example #1
0
        protected override void OnVisualParentChanged(DependencyObject oldParent)
        {
            base.OnVisualParentChanged(oldParent);

            FieldValueProviderCollection providers = VisualTree.FindFieldValueProviderCollection(this);

            if (providers != null)
            {
                VisualTree.WithFieldDefinitionContainer(this, definition => providers.Add(definition.Identifier, this));
            }
        }
Example #2
0
 private void TryRegisterSelf()
 {
     if (!isAdded)
     {
         FieldValueProviderCollection collection = VisualTree.FindFieldValueProviderCollection(this);
         if (collection != null)
         {
             collection.Add(Definition.Identifier, this);
             isAdded = true;
         }
     }
 }
Example #3
0
 public static void SetValueProviderCollection(DependencyObject obj, FieldValueProviderCollection value)
 {
     obj.SetValue(ValueProviderCollectionProperty, value);
 }