You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Styles.xaml that contains a Converter that uses a SolidColorBrush from the App.Current.Resources that is also defined in the same Styles.xaml. The Converter reads the color once in its constructor by calling App.Current.Resources["MyColor"]. That works on Windows but on Mac it is null.
If I later do the same call, the resource is available. So the workaround here is to simply check for null and lazy-load the resource later. But I'm afraid this "leaks" into more places in my codebase. So something expects a resource to be there but it is not loaded/initialized yet.
First question: is there a more robust way of loading resources in this case?
Second question: should this be an issue as the behavious differs between Windows and Mac/Desktop?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I have a Styles.xaml that contains a Converter that uses a SolidColorBrush from the App.Current.Resources that is also defined in the same Styles.xaml. The Converter reads the color once in its constructor by calling
App.Current.Resources["MyColor"]. That works on Windows but on Mac it is null.If I later do the same call, the resource is available. So the workaround here is to simply check for null and lazy-load the resource later. But I'm afraid this "leaks" into more places in my codebase. So something expects a resource to be there but it is not loaded/initialized yet.
First question: is there a more robust way of loading resources in this case?
Second question: should this be an issue as the behavious differs between Windows and Mac/Desktop?
All reactions