Question: ```
check = false;

$("#sidebar").click(function() {
    $("#wrapper").toggleClass("playsidebar");
    if (check == false) {
        $("#div").css({ "padding-left": "300px" });
        check = true;
    } else {
        $("#div").css({ "padding-right": "300px" });
        check = false;
    }
});

```

Thats a function is open a side-bar when the button is pressed. The function is actually works fine for the first and two times, but after that its just open and close the side-bar without actually padding left or right. 

Someone can understand whats wrong? Thanks!

Answer: 
We need user supplied filter string in our `FilterText` property of `behaviors:TextFilter` class. 

Create a simple class FilterPropertyElement : 

```
    public class FilterPropertyElement : FrameworkElement
    {
        public override string ToString()
        {
            return Tag.ToString();
        }
    }    

```

Declare the resource 

```
<Window.Resources>
         <local:FilterPropertyElement x:Key="FilterPropertyKey" Tag="some filter key value"/>
</Window.Resources>

```

Change your TextFilter definition to use the Resource. : 

```
<behaviors:TextFilter FilterText="{Binding Path=Tag, Source={StaticResource FilterPropertyKey}}"/>

```

Apply binding to the TextBox from where to get filter criteria

```
<TextBox Text="{Binding Path=Tag, Source={StaticResource FilterPropertyKey}, UpdateSourceTrigger=LostFocus}" />

```
What I ended up doing, inspired by AnjumSKhan's answer, was to add the filter to the rood `Resources` collection and have the `TextBox` bind to it:

```
<UserControl.Resources>
    <b:TextFilter x:Key="SearchTextFilter" />
    <CollectionViewSource Source="{Binding ListOfStuff}"  x:Key="FilteredListOfStuff">
        <i:Interaction.Behaviors>
            <b:FilterBehavior>
                <b:PropertyFilter Property="SomePropName">
                    <StaticResource ResourceKey="SearchTextFilter"/>
                </b:PropertyFilter>
            </b:FilterBehavior>
        </i:Interaction.Behaviors>
    </CollectionViewSource>
</UserControl.Resources>
.
.
.
<TextBox Text="{Binding Path=FilterText, Source={StaticResource SearchTextFilter}, Mode=OneWayToSource}"/>

```

This is still not as clean as I'd like, but it's the best I can come up with, if anyone got a better solution please let me know.