I want to make an WPF app for browsing recipes for dishes. Having trouble with filtering data.
I\'m using ItemsControl to make my data look like \"tiles\" in the win
this.DataContext = ItemsView;
- with such DataContext binding Text="{Binding Szukane}"
cannot possibly work, bacause Szukane is not a property of ItemsView. you need to change binding source:
Text="{Binding Szukane, RelativeSource={RelativeSource AncestorType=Page} UpdateSourceTrigger=PropertyChanged}"
Alternatively create a view model, with contains both ItemsView and Szukane properties, and use it for DataContext.
I also recommend to add a delay for Text binding to reduce amount of filtering while typing:
Text="{Binding Szukane, Delay=250, RelativeSource=...}