Hi Jeronimo, thanks for reaching out with your questions.
If you have a globally cached dynamic enumeration that is sourced by a cache loader, and need to refresh the cache when the values change, you can just remove that lookup table from the cache, and it will be reloaded automatically whenever the properties try to show a list of values or look up a value in the table. If you also need to refresh the list of values or the current values for any enum properties displayed on the screen, then you can manually have them fire a PropertyChange.Items event, or update their value respectively.
For example, in our demo we had a cached list of sales persons, because you don't update them often. But if you do update a sales person, then you can call a method like the one below.
Code:
public async Task ReloadCachedSalesPersons()
{
// if you add, update or delete a sales person, you need to remove the cached table
var cache = LookupCache.Get(ServiceProvider, LookupCache.Global);
cache.RemoveLookupTable(Enumerations.SalesPerson.EnumName);
// to reload and cache a new list of sales persons immediately, make the following call
await cache.GetLookupTableAsync(Enumerations.SalesPerson.EnumName);
// or you can make the control bound to the SalesPersonIdProperty update
// its list of items, which will also reload the cache, as follows
await SalesPersonIdProperty.FirePropertyChangeAsync(
new PropertyChangeEventArgs(PropertyChange.Items, null, null, null));
}
Is this what you were looking for?
Please let us know if this works for you, or if you have any other questions.