Hi,
I need to get notified if user changes macOS theme. I can get the current theme with:
var interfaceStyle = NSUserDefaults.StandardUserDefaults.StringForKey("AppleInterfaceStyle");
I want to be notified when user changes the theme so I added observer to StandardUserDefaults in my AppDelegate constructor:
themeObserver = NSUserDefaults.StandardUserDefaults.AddObserver("AppleInterfaceStyle", NSKeyValueObservingOptions.New, this.HandleAction) as NSObject;
Problem: After starting application, first time I change the theme I get the event with few seconds delay and after that the delay gets even longer. It feels quite random when I get the event.
Any suggestions?
Thanks!