Restore automatic Load in OnContentChanged, rename to ReloadContent

- Add new OnContentChanged so derived types can fire ContentChanged
- Issue MatterHackers/MCCentral#2748
Investigate ~30 failing tests due to OnContentChanged revision
This commit is contained in:
John Lewin 2018-02-01 09:01:57 -08:00
parent 1151bfba25
commit 085be24c2d
4 changed files with 22 additions and 16 deletions

View file

@ -66,12 +66,20 @@ namespace MatterHackers.MatterControl.Library
public virtual string KeywordFilter { get; set; } = "";
/// <summary>
/// Reloads the container when contents have changes and fires ContentChanged to notify listeners
/// </summary>
protected void ReloadContent()
{
// Call the container specific reload implementation
this.Load();
// Notify
this.OnContentChanged();
}
protected void OnContentChanged()
{
// Caller the reload then use OnContentChange to fire notification
//// Reload the container when new contents are available
//this.Load();
this.ContentChanged?.Invoke(this, null);
}