void Initialize(swc.DataGridCell cell, swc.ComboBox control, object dataItem)
            {
                var collection = new CollectionHandler {
                    Handler = Handler
                };

                collection.Register(Handler.Widget.DataStoreBinding.GetValue(dataItem));
                control.ItemsSource = collection.Items;

                if (!IsControlInitialized(control))
                {
                    control.DataContextChanged += (sender, e) => SetValue(control.GetParent <swc.DataGridCell>(), (swc.ComboBox)sender, e.NewValue);
                    SetControlInitialized(control, true);
                }
                SetValue(cell, control, dataItem);
            }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Eto.Forms.FilterCollection{T}"/> class with the specified <paramref name="collection"/>.
        /// </summary>
        /// <param name="collection">Collection of items as the source of this collection.</param>
        public FilterCollection(IEnumerable <T> collection)
        {
            var changed = collection as INotifyCollectionChanged;

            if (changed != null)
            {
                changedHandler = new CollectionHandler {
                    List = this
                };
                changedHandler.Register(collection);
            }
            else
            {
                items = new List <T>(collection);
            }
        }