Why DataBinding is not working?
<TextBox Text="{Binding Path=local:MainWindow.SearchPlayer,
Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
this is my class:
public partial class MainWindow : Window
{
private Store store = new Store();
private string _searchPlayer;
public string SearchPlayer
{
get
{
return _searchPlayer;
}
set
{
_searchPlayer = value;
if(_searchPlayer!="")
{
ACT.DataContext = store.SearchedPlayers
.Where(x => x.StartsWith(_searchPlayer)).ToList();
}
else
{
ACT.DataContext = store.Last10SearchedPlayers;
}
}
}
public MainWindow()
{...............}
I set breakpoint on SearchPlayer setter but it's never worked.