Hi and thanks for the reply.
I get the following exception: NullReferenceException
Object Reference not set to an instance of an object
It occurs in the following class:
public class DISPATCHER
{
private static CoreDispatcher dispatcher;
public static void Initialize()
{
dispatcher = Window.Current.Dispatcher;
}
public static void ExecuteAsync(Action action)
{
if (dispatcher.HasThreadAccess)
action();
else dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());
}
public static void Execute(Action action)
{
InnerExecute(action).Wait();
}
private static async Task InnerExecute(Action action)
{
if (dispatcher.HasThreadAccess)
action();
else await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());
}
The exception error occurs in:
if (dispatcher.HasThreadAccess)
Many thanks in advance,
michael