예제 #1
0
        private void UpdateFilter(IAcObjectNew selectObject)
        {
            ClearFilter();

            var listView = InnerItemsSource;

            if (listView == null)
            {
                return;
            }

            var baseFilter = BasicFilter;
            var userFilter = UserFilter;

            var filter = string.IsNullOrWhiteSpace(baseFilter) ? userFilter
                : string.IsNullOrWhiteSpace(userFilter) ? baseFilter : baseFilter + @" & (" + userFilter + @")";

            InnerItemsSource.CurrentChanged -= ItemsSource_CurrentChanged;
            using (listView.DeferRefresh()) {
                if (string.IsNullOrWhiteSpace(filter))
                {
                    listView.Filter = null;
                }
                else
                {
                    _filter         = Filter.Create(UniversalAcObjectTester.Instance, filter);
                    listView.Filter = FilterFunc;
                    _observableCollection.ItemPropertyChanged += Collection_ItemPropertyChanged;
                    _observableCollection.WrappedValueChanged += Collection_WrappedValueChanged;
                }
            }
            InnerItemsSource.CurrentChanged += ItemsSource_CurrentChanged;

            listView.MoveCurrentToOrNull(selectObject);
        }
예제 #2
0
        public void MoveCurrentToOrFirst(IAcObjectNew obj) {
            if (obj == null) {
                base.MoveCurrentTo(null);
                return;
            }

            var current = InternalList.Cast<AcItemWrapper>().FirstOrDefault(x => x.Value == obj);
            MoveCurrentTo(current ?? (Count > 0 ? GetItemAt(0) : null));
        }
예제 #3
0
        public void MoveCurrentTo(IAcObjectNew obj) {
            if (obj == null) {
                base.MoveCurrentTo(null);
                return;
            }

            var current = InternalList.Cast<AcItemWrapper>().FirstOrDefault(x => x.Value == obj);
            if (current != null) {
                MoveCurrentTo(current);
            }
        }
예제 #4
0
        public void MoveCurrentToOrNull(IAcObjectNew obj)
        {
            if (obj == null)
            {
                base.MoveCurrentTo(null);
                return;
            }

            var current = InternalList.Cast <AcItemWrapper>().FirstOrDefault(x => x.Value == obj);

            MoveCurrentTo(current);
        }
예제 #5
0
        private void UpdateFilter(IAcObjectNew selectObject) {
            ClearFilter();

            var listView = InnerItemsSource;
            if (listView == null) return;

            var baseFilter = BasicFilter;
            var userFilter = UserFilter;

            var filter = string.IsNullOrWhiteSpace(baseFilter) ? userFilter
                : string.IsNullOrWhiteSpace(userFilter) ? baseFilter : baseFilter + @" & (" + userFilter + @")";

            InnerItemsSource.CurrentChanged -= ItemsSource_CurrentChanged;
            using (listView.DeferRefresh()) {
                if (string.IsNullOrWhiteSpace(filter)) {
                    listView.Filter = null;
                } else {
                    _filter = Filter.Create(UniversalAcObjectTester.Instance, filter);
                    listView.Filter = FilterFunc;
                    _observableCollection.ItemPropertyChanged += Collection_ItemPropertyChanged;
                    _observableCollection.WrappedValueChanged += Collection_WrappedValueChanged;
                }
            }
            InnerItemsSource.CurrentChanged += ItemsSource_CurrentChanged;

            listView.MoveCurrentToOrNull(selectObject);
        }