Application.Current.Resources empty in ScheduledTaskAgent?
I want to regenerate tiles based on external changes in my ScheduledTaskAgent.
开发者_运维问答I am calling the same code that I use in my app. This code makes use of some resources defined in Application.Current.Resources, and this collection is empty when used from the ScheduledTaskAgent.
Does anyone know of a way to force this collection to be loaded, or am I going to have to manually create my brushes, etc?
Background agents run in the background (hence the name) and do not fully load your application (from a UI perspective at least), hence the empty Resources collection.
Given the background nature of these tasks, it would seem strange that you would need access to these resources, though. Perhaps if you explain your scenario a little further so we can provide more help.
精彩评论