Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GridColumnViewModel"/> class.
        /// </summary>
        /// <param name="parentColumnList">The parent column list.</param>
        /// <param name="systemName">Name of the system.</param>
        /// <param name="parentNotifyLayoutChanged">The parent notify layout changed.</param>
        public GridColumnViewModel(IList<IGridColumn> parentColumnList, string systemName, INotifyLayoutChanged parentNotifyLayoutChanged)
        {
            _column = new GridColumn { SystemName = systemName };
            _parentColumnList = parentColumnList;
            _parentNotifyLayoutChanged = parentNotifyLayoutChanged;

            InitializeDefaultValues();
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GridColumnViewModel"/> class.
        /// </summary>
        /// <param name="parentColumnList">The parent column list.</param>
        /// <param name="column">The column.</param>
        /// <param name="parentNotifyLayoutChanged">The parent notify layout changed.</param>
        /// <param name="index">The index.</param>
        public GridColumnViewModel(IList<IGridColumn> parentColumnList, IGridColumn column, INotifyLayoutChanged parentNotifyLayoutChanged, int index)
        {
            _parentColumnList = parentColumnList;
            _column = column;
            _parentNotifyLayoutChanged = parentNotifyLayoutChanged;
            OnGroupLevelChanged();
            Index = index;
            //_layoutChanged = layoutChanged;

            Observable.FromEventPattern<PropertyChangedEventHandler, PropertyChangedEventArgs>(x => this.PropertyChanged += x,
                x => this.PropertyChanged -= x)
                .Where(et => et.EventArgs.PropertyName == "Width")
                .Throttle(TimeSpan.FromMilliseconds(500), DispatcherScheduler.Current)
                .Subscribe(d => OnLayoutChanged());

            InitializeDefaultValues();
        }