I have a Silverlight 3 control where I am using an ItemsControl to display a list of items. I have implemented a "filter" or "search" textbox that allows the user to enter a search term in a textbox on the control that will limit the items displayed in the ItemsControl to ones that contain the string entered in the textbox. I have been able to implement this functionality, but I'd like to enhance it by changing the color of the text of the search term in the text that is displayed in the items control. For example, if the user types "foo" in the search textbox, I would like to filter the items in the ItemsControl (which I am already doing) to items that contain "foo", and change the background color of the substring "foo" where it occurs in the ItemsControl.
Ideally, I would implement an IValueConverter and pass the value in the search textbox as the parameter to the converter. The converter could then search through the value that is being converted and change the background color of all "foo" substrings (not sure how I'm going to do this yet, something with Inlines maybe?). It seems parameter values passed to value converters must be static resources. Is there any way I can pass a non-static value to the value converter to accomplish what I'm trying to do? Is there another way I should be going about this that does not use an IValueConverter?