コード例 #1
0
        // <summary>
        // Basic ctor
        // </summary>
        // <param name="parentValue">Parent PropertyValue</param>
        public ModelPropertyValueCollection(ModelPropertyValue parentValue) : base(parentValue) 
        {
            if (parentValue == null)
            {
                throw FxTrace.Exception.ArgumentNull("parentValue");
            }

            // Wrap each existing item in the collection in ModelPropertyEntryIndexer
            ModelItemCollection collection = this.GetRawCollection();
            if (collection != null && collection.Count > 0) 
            {
                _values = new List<ModelPropertyIndexer>();
                int i = 0;
                foreach (ModelItem item in collection) 
                {
                    _values.Add(CreateModelPropertyIndexer(item, i++));
                }
            }

            // Hook into the collection changed events
            if (collection != null)
            {
                collection.CollectionChanged += new NotifyCollectionChangedEventHandler(OnUnderlyingCollectionChanged);
            }
        }
コード例 #2
0
        public ModelPropertyEntry(ModelProperty property, ModelPropertyValue parentValue)
            : base(parentValue) 
        {

            _valueCache = new CachedValues(this);
            SetUnderlyingModelPropertyHelper(property, false);
        }
コード例 #3
0
        public ModelPropertyEntry(IEnumerable<ModelProperty> propertySet, ModelPropertyValue parentValue)
            : base(parentValue) 
        {

            _valueCache = new CachedValues(this);
            SetUnderlyingModelPropertyHelper(propertySet, false);
        }
        // <summary>
        // Basic ctor
        // </summary>
        // <param name="parentValue">Parent PropertyValue</param>
        public ModelPropertyValueCollection(ModelPropertyValue parentValue) : base(parentValue)
        {
            if (parentValue == null)
            {
                throw FxTrace.Exception.ArgumentNull("parentValue");
            }

            // Wrap each existing item in the collection in ModelPropertyEntryIndexer
            ModelItemCollection collection = this.GetRawCollection();

            if (collection != null && collection.Count > 0)
            {
                _values = new List <ModelPropertyIndexer>();
                int i = 0;
                foreach (ModelItem item in collection)
                {
                    _values.Add(CreateModelPropertyIndexer(item, i++));
                }
            }

            // Hook into the collection changed events
            if (collection != null)
            {
                collection.CollectionChanged += new NotifyCollectionChangedEventHandler(OnUnderlyingCollectionChanged);
            }
        }