Exemplo n.º 1
0
        /// <summary>
        /// Setter for <see cref="VisualSetupsProperty"/>
        /// </summary>
        public static void SetVisualSetups(DependencyObject obj, DependencyObjectCollectionOfT <VisualSetupGroup> value)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            obj.SetValue(VisualSetupsProperty, value);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Getter for <see cref="VisualSetupsProperty"/>
        /// </summary>
        public static DependencyObjectCollectionOfT <VisualSetupGroup> GetVisualSetups(DependencyObject obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            var collection = (DependencyObjectCollectionOfT <VisualSetupGroup>)obj.GetValue(VisualSetupsProperty);

            // If the collection wasn't yet set
            if (collection == null)
            {
                // Create a new instance
                collection = new DependencyObjectCollectionOfT <VisualSetupGroup>();

                // And set it for the object
                obj.SetValue(VisualSetupsProperty, collection);
            }

            return(collection);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 protected VisualSetupBase()
 {
     Setters          = new DependencyObjectCollectionOfT <IVisualSetter>();
     TemporarySetters = new DependencyObjectCollectionOfT <ITemporaryVisualSetter>();
 }