Does anyone know why this code doesn\'t work:
public class CollectionViewModel : ViewModelBase {
public ObservableCollection Con
Instead of an ObservableCollection or TrulyObservableCollection, consider using a BindingList and calling the ResetBindings method.
For example:
private BindingList _tfsFiles;
public BindingList TfsFiles
{
get { return _tfsFiles; }
set
{
_tfsFiles = value;
NotifyPropertyChanged();
}
}
Given an event, such as a click your code would look like this:
foreach (var file in TfsFiles)
{
SelectedFile = file;
file.Name = "Different Text";
TfsFiles.ResetBindings();
}
My model looked like this:
namespace Models
{
public class TfsFile
{
public string ImagePath { get; set; }
public string FullPath { get; set; }
public string Name { get; set; }
public string Text { get; set; }
}
}