Equivalent ReloadData to NSCollectionView for redrawing element views

I have a switch for changing font attributes. In my NSOutlineView, I call ReloadData so that everything is re-rendered. However, how can I get NSCollectionView to re-render. I tried

cvReader.NeedsLayout= true; cvReader.Layout(); cvReader.NeedsDisplay = true; cvReader.Display(); 

to no avail. Any hints were greatly appreciated.

Update. I also tried

 cvReader.NeedsDisplay = true; cvReader.Window.ViewsNeedDisplay = true; cvReader.Window.FlushWindowIfNeeded(); 

As well as assigning content again. It looks like the views of the elements are cached and not restored. Maybe there is a way to clear the item cache file?

+1
source share
1 answer

It turns out that NSCollectionView element views can be updated by setting ItemPrototype, for example,

 ItemPrototype = new SomeViewController() 

This will recreate all existing views.

+3
source

All Articles