Since you're having an issue with the DropShadowPanel, I guess you want a shadow for the text, not a border.
If that is the case, you can do the following:
<TextBlock Text="My text" Foreground="Black" RenderTransformOrigin="0.5,0.5" >
<TextBlock.RenderTransform>
<CompositeTransform TranslateX="1" TranslateY="1"/>
</TextBlock.RenderTransform>
</TextBlock>
<TextBlock Text="My text" Foreground="White" />
This will create a shadow effect.
EDIT
I think I've got what you want. You'll still need two TextBlock in your XAML.
<Grid x:Name="grid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<!--TextBlock that will receive the shadow-->
<TextBlock FontSize="46" Text="My text" Foreground="White" x:Name="shadowTextBlock" />
<!--Let this TextBlock foreground black just for design time-->
<TextBlock FontSize="46" Text="My text" Foreground="Black" x:Name="foregroundTextBlock"/>
</Grid>
Then you'll need the following code at page_loaded:
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
// Set the right color to the foreground text
this.foregroundTextBlock.Foreground = this.shadowTextBlock.Foreground;
var compositor = ElementCompositionPreview.GetElementVisual(this.grid).Compositor;
var spriteVisual = compositor.CreateSpriteVisual();
spriteVisual.Size = this.grid.RenderSize.ToVector2();
var dropShadow = compositor.CreateDropShadow();
dropShadow.Mask = this.shadowTextBlock.GetAlphaMask();
dropShadow.Color = Colors.Black;
dropShadow.Offset = new Vector3(0, 0, -50);
spriteVisual.Shadow = dropShadow;
ElementCompositionPreview.SetElementChildVisual(this.shadowTextBlock, spriteVisual);
}
The result really looks like your example:
