Hi all,

As you no doubt can see by the postings i've been making, i'm trying to get my head around the differences between wpf and winforms development. The lights are slowly coming on, but as i encounter each problem, a new speedbump in the road to learning presents itself. Hence my next question.

In my previous winforms app, i had a bindingsource attached to a combobox, and based on a variable i would filter that bindingsource to in turn filter the items in the combobox - example:

Code:
if salesrep = true
   CustomerBindingSource.filter = "Territory = '" & territory & "'"
else
   CustomerBindingSource.removefilter()
endif
that code would filter the contents of the combobox to only be the currently logged in sales reps customers.

On the WPF side in the window_activated event, i've added the following:

Code:
 Dim CustomerViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("CustomerViewSource"), System.Windows.Data.CollectionViewSource)

If salesrep = True 
   CustomerViewSource.View.Filter = territory  'show only that reps customers
Else
    CustomerViewSource.View.Filter = Nothing  'show all customers
End If
which of course does not work.....so my question is, is a viewsource the route i should take to try and duplicate the behavior of a bindingsource i mentioned above or is there another route, and if so, how do you filter the viewsource if its the right way to go?

as usual, thanks a million.