NullReferenceException using TextAlignment.Center

Hi all.
I’ve got a weird behaviour (on version 4.2) using “TextAlignment” on a Text component.
The following code…

Text message = new Text(MyFont, "My text");
message.SetMargin(20);
message.TextAlignment = TextAlignment.Center;
message.Visibility = Visibility.Hidden;

StackPanel sp = new StackPanel();
sp.Children.Add(message);

display.WPFWindow.Child = sp;

will raise a NullReferenceException at runtime

Using mainboard GHI Electronics FEZSpider version 1.0
Program Started
    #### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (1) ####
    #### Message: 
    #### Microsoft.SPOT.Presentation.Media.MediaContext::RenderMessageHandler [IP: 00e0] ####
    #### Microsoft.SPOT.Dispatcher::PushFrameImpl [IP: 0054] ####
    #### Microsoft.SPOT.Dispatcher::PushFrame [IP: 001a] ####
    #### Microsoft.SPOT.Dispatcher::Run [IP: 0006] ####
    #### Gadgeteer.Program::Run [IP: 0020] ####
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.SPOT.TinyCore.dll

… but if I comment the line…

message.TextAlignment = TextAlignment.Center;

…it perfectly works !

The same error is encountered for every value of the enumeration (Left, Right, Center)

What’s the problem with TextAlignment?

I found the same weird behaviour with this code on version 4.2:

_title = new Text(_titleFont, title);
_title.ForeColor = Colors.Red; // THIS WILL GIVE NullReferenceException. Removing it the code runs fine
_title.SetMargin(3);
_mainStackPanel.Children.Add(_title);

and with this code


// THIS WILL GIVE NullReferenceException. Removing it the code runs fine
_stackPanel.Background = new SolidColorBrush(Colors.White); 

Maybe the problems are somehow connected ?