Hi,
I have a listview with different the datatemplates set up to bind. I want to update some of the columns (mix of textblock and progress bar) when I call UpdateSource() on a bindingexpression. I also want to update 1 of the columns when the property is changed which it is bound too.
I was able to get the PropertyChanged behaviour to work. But whenever I change the property of one of the other columns they update straight await, instead of on the UpdateSource call. It would appear that its ignoring the UpdateSourceTrigger which is set in the xaml and is using the default behaviour.
I have a class which implements the INotifyPropertyChanged interface.
The xaml for the column I want to update explicitly looks like this:
<GridViewColumn Width="300" Header="Percentage" DisplayMemberBinding="{Binding Percentage, UpdateSourceTrigger=Explicit}" />
And the xaml for one which I want to update on property change:
<GridViewColumn Header="Status" Width="150" DisplayMemberBinding="{Binding Status, UpdateSourceTrigger=PropertyChanged}" />
My binding is set originally like so:
Binding downloadBinding = new Binding();
downloadBinding.Source = _downloads;
ListDownloads.SetBinding(ListView.ItemsSourceProperty, downloadBinding);
If I execute the following code:
_downloads[0].Percentage += 0.3;
_downloads[0].FileSize = 700.00;
_downloads[1].Percentage += 10;
The column percentage column is updated straight away, but I would expect it to wait for the call on UpdateSource().
My code for updating the source is:
BindingExpression be = ListDownloads.GetBindingExpression(ListView.ItemsSourceProperty);
be.UpdateSource();
Am I missing something? I can't find anything online or in a book about why this is happening.
Cheers