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); }
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)); }
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); } }
public void MoveCurrentToOrNull(IAcObjectNew obj) { if (obj == null) { base.MoveCurrentTo(null); return; } var current = InternalList.Cast <AcItemWrapper>().FirstOrDefault(x => x.Value == obj); MoveCurrentTo(current); }
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); }