Example #1
0
 private void OnItemsSourceChanged()
 {
     if (_listBox != null)
     {
         if (ItemsSource != null)
         {
             FilteredItems = (IObservableCollectionView)typeof(ObservableCollectionView <>)
                             .CreateGenericObject(ItemsSource.GetType().GenericTypeArguments[0], ItemsSource);
             FilteredItems.Filter = new Func <object, bool>(ApplyFilter);
             _listBox.ItemsSource = FilteredItems;
         }
         else
         {
             _listBox.ItemsSource = null;
         }
     }
 }
Example #2
0
        private void OnItemsSourceChanged()
        {
            if (_listBox != null)
            {
                if (ItemsSource != null)
                {
                    FilteredItems = (IObservableCollectionView)typeof(ObservableCollectionView<>)
                        .CreateGenericObject(ItemsSource.GetType().GenericTypeArguments[0], ItemsSource);
                    FilteredItems.Filter = new Func<object, bool>(ApplyFilter);
                    _listBox.ItemsSource = FilteredItems;
                }
                else
                    _listBox.ItemsSource = null;

                
            }
        }