Support a ListCollectionView for a GraphicsLayer GraphicSource (WPF/.NET)

Idea created by epaitz-esristaff Employee on Nov 10, 2014
    New
    Score10
    The WPF ListBox supports filtering by using a ListCollectionView or an ICollectionView and defining the Filter Predicate of the View. This allows several views to be created against the same source collection. The same functionality needs to be supported with the GraphicsLayer and its GraphicSource. Something like the following.
     
    Graphics = new ObservableCollection<Graphic>();
    GraphicsView = new ListCollectionView(Graphics);
    GraphicsView.Filter = new Predicate<object>(GraphicsViewFilter);
    
    private bool GraphicsViewFilter(object item){
       return true;  //Custom filter logic goes her
    }
    Binding binding = new Binding("GraphicsView") { Source = ViewModel };
    BindingOperations.SetBinding(graphicsLayer, GraphicsLayer.GraphicsSourceProperty, binding);

    This would allow many GraphicsLayers to be created against a single source Collection but display different results.