コード例 #1
0
        /// <summary>
        /// Fire ColumnCount changed event for GridPattern
        /// </summary>
        private void OnColumnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (_oldColumnsCount != _owner.Columns.Count)
            {
                ListViewAutomationPeer peer = UIElementAutomationPeer.FromElement(_listview) as ListViewAutomationPeer;
                Invariant.Assert(peer != null);
                if (peer != null)
                {
                    peer.RaisePropertyChangedEvent(GridPatternIdentifiers.ColumnCountProperty, _oldColumnsCount, _owner.Columns.Count);
                }
            }

            _oldColumnsCount = _owner.Columns.Count;

            AutomationPeer lvPeer = UIElementAutomationPeer.FromElement(_listview);

            if (lvPeer != null)
            {
                List <AutomationPeer> list = lvPeer.GetChildren();
                if (list != null)
                {
                    foreach (AutomationPeer peer in list)
                    {
                        peer.InvalidatePeer();
                    }
                }
            }
        }
コード例 #2
0
        // Token: 0x060026B5 RID: 9909 RVA: 0x000B7DAC File Offset: 0x000B5FAC
        private void OnColumnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (this._oldColumnsCount != this._owner.Columns.Count)
            {
                ListViewAutomationPeer listViewAutomationPeer = UIElementAutomationPeer.FromElement(this._listview) as ListViewAutomationPeer;
                Invariant.Assert(listViewAutomationPeer != null);
                if (listViewAutomationPeer != null)
                {
                    listViewAutomationPeer.RaisePropertyChangedEvent(GridPatternIdentifiers.ColumnCountProperty, this._oldColumnsCount, this._owner.Columns.Count);
                }
            }
            this._oldColumnsCount = this._owner.Columns.Count;
            AutomationPeer automationPeer = UIElementAutomationPeer.FromElement(this._listview);

            if (automationPeer != null)
            {
                List <AutomationPeer> children = automationPeer.GetChildren();
                if (children != null)
                {
                    foreach (AutomationPeer automationPeer2 in children)
                    {
                        automationPeer2.InvalidatePeer();
                    }
                }
            }
        }
コード例 #3
0
        ///
        void IViewAutomationPeer.ItemsChanged(NotifyCollectionChangedEventArgs e)
        {
            ListViewAutomationPeer peer = UIElementAutomationPeer.FromElement(_listview) as ListViewAutomationPeer;

            if (peer != null)
            {
                if (_oldItemsCount != _listview.Items.Count)
                {
                    peer.RaisePropertyChangedEvent(GridPatternIdentifiers.RowCountProperty, _oldItemsCount, _listview.Items.Count);
                }
                _oldItemsCount = _listview.Items.Count;
            }
        }