Instance per Thread#190
Conversation
Implemented InstanceLocator to get singleton or per thread instances. Adapted all Providers and Dictionary to use the new instance logic.
|
@Mahriel thansk for this PR, please can you just fix the 4 small new Codefactor issues. |
hopefully fixed the codefactor errors
|
Is this change necessary or we better clean and fix existing code? See my comment in #189 |
@konne: the PR is not mature enough and doesn't contain even a single test. to me this is a big untested/unproven change and we should stay away from it |
|
|
|
|
@konne what is this cla assistant? We have another license than the one pointed out in the link. |
| Instance = null; | ||
| var instance = Instance; | ||
| InstanceLocator.Dissolve(instance); | ||
| instance = null; |
There was a problem hiding this comment.
It seems to me should be Instance = null
#189
When it comes to bigger ui multi-threaded applications the WPFLocalizationExtension is losing a lot of performance on cross thread calls while
ILocalizationProvider.ProviderChangedis called.Therefor I implemented a new feature to use an instance per thread and not a singleton instance.
As long as
LocalizeSettings.Instance.UseThreadInstancesisn't activated the program will do the same as before and use a singleton instance.When the flag is activated you'll get a instance per thread for the LocalizeDictionary and all Providers. You should be using the
LocalizeSettings.Instanceinstead ofLocalizeDictionary.Instanceto change settings, like the current culture, for all instances.