How to update the GUI

I am having an issue trying to update the GUI text boxes. I am using the following code that gets called after the window is displayed but if I put a break point on the first line of the code within the Dispatcher, it never gets called. If I put a breakpoint on the first line with UpdateDisplay, that indeed gets called.

    private void UpdateDisplay()
        Application.Current.Dispatcher.Invoke(TimeSpan.FromMilliseconds(1), _ =>
            apnTextBox.Text = SystemConfigurationClass.configData.apn;
            mqttUseLoginCheckBox.IsChecked = SystemConfigurationClass.configData.useLogin;
            mqttServerTextBox.Text = SystemConfigurationClass.configData.mqttServer;
            mqttPortTextBox.Text = SystemConfigurationClass.configData.mqttPort.ToString();
            mqttUsernameTextBox.Text = SystemConfigurationClass.configData.mqttUsername;
            mqttPasswordTextBox.Text = SystemConfigurationClass.configData.mqttPassword;
            return null;
        }, null);

Is this the correct way to update the GUI? I know it has to be done from a dispatcher as they are not visible outside the main GUI thread.

I also found that if I call UpdateDisplay from Program.cs in the same function that selects the current window for viewing, I can do this without the Dispatcher.Invoke above.

Not 100% sure how the Dispatcher is implemented in TinyCLR/NETMF, but if you call UpdateDisplay from the dispatcher thread the I expect you get an Deadlock here, because DIspatcher.Invoke() blocks and therefore the Dispatcher does not call any more methods.
You should use Dispatcher.Invoke only if Dispatcher.CheckAccess() returns false. If it returns true it is safe just run your code.
I usually use code like this:

private void UpdateDisplay()
   if (!Dispatcher.CheckAccess())
      Disptcher.Invoke(() => UpdateDisplay);
   // put your code here

Also, in Windows Dispatcher.BeginInvoke() is available. it does not block, but also does not give access to the return value. Using BeginIvoke when ever possible prevents deadlocks.