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:1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public async Task ReloadCachedSalesPersons()
{
var cache = LookupCache.Get(ServiceProvider, LookupCache.Global);
cache.RemoveLookupTable(Enumerations.SalesPerson.EnumName);
await cache.GetLookupTableAsync(Enumerations.SalesPerson.EnumName);
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.