>Ii have found that the varaible must be defined as public if you are going to use it in a filter.
Not true at all - the variable can be a private variable that is in scope at all times that the filter is in effect; in some cases, it may be preferable to use a member property of an object that will be resolvable whenever the filter is in effect may be a better choice.