The problem is totally unrelated to DLL, it is related to the use of the threading with UI. The timer even is not guaranteed to be invoked on the same thread, that's the problem.
You cannot call any method or property of the currently executing UI from any thread other then UI thread. For solving such problems, there is the method
CoreDispatcher.RunAsync
. It queues some callback with the parameters needed for the call to the UI thread; eventually, you call will be performed by the UI thread. This is the way you can notify the UI thread from other threads. The detail depends on exact language and API you use; please see:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.coredispatcher.aspx[
^].
—SA