/// <inheritdoc /> public override void Init() { base.Init(); this.AddBinding(this.Collection); if (!string.IsNullOrEmpty(this.ConverterType)) { // Create data converter. this.valueConverter = (ValueConverter)Activator.CreateInstance(ReflectionUtils.FindType(this.ConverterType)); } else { Debug.LogWarning("No converter set", this); } // Observe collection. this.collectionBinding = new CollectionDataBinding <object>(this.Collection) { CollectionChanged = this.OnCollectionChanged, ItemAdded = this.OnItemAdded, ItemInserted = this.OnItemInserted, ItemRemoved = this.OnItemRemoved }; }
/// <inheritdoc /> public override void Deinit() { base.Deinit(); this.RemoveBinding(this.Collection); this.collectionDataBinding = null; }
/// <inheritdoc /> public override void Deinit() { base.Deinit(); this.RemoveBinding(this.Collection); this.valueConverter = null; this.collectionBinding = null; }
/// <inheritdoc /> public override void Init() { base.Init(); this.collectionDataBinding = new CollectionDataBinding(this.Collection) { ItemAdded = this.OnItemAdded, ItemInserted = this.OnItemInserted, ItemRemoved = this.OnItemRemoved, ClearedItems = this.OnClearedItems, CollectionChanged = this.OnCollectionChanged }; this.AddBinding(this.Collection); }