SilverlightのStaticResouceで定義したコントロールをContentプロパティにバインドするとXamlParseExceptionが発生する。

ユーザコントロールのResurcesにパスやテキストブロックなどのコントロールを定義します。このリソースをボタンなどのContentControl系コントロールのContentプロパティにバインドすると実行時エラーが発生します。
例えば、以下のXAMLを持つユーザコントロールをnewするとXAMLパースのタイミングで実行時エラーが起きます。

<UserControl x:Class="SilverlightApplication1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <Path x:Key="Path1" Fill="Gold" Stroke="Black" StrokeThickness="1">
            <Path.Data>
                <EllipseGeometry Center="50,50" RadiusX="50" RadiusY="50" />
            </Path.Data>
        </Path>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <!--ContentにStaticResorceのコントロールをバインドすると、実行時にXamlParseExceptionが発生する-->
        <Button Content="{StaticResource Path1}"/>
    </Grid>
</UserControl>

VisualStudioのデザイナ画面では表示できているのが何とも言えない感覚にさせます。

ちなみにContentに直接パスを定義すると正常に実行できます。

<!--これはOK-->
<Button>
    <Path Fill="Gold" Stroke="Black" StrokeThickness="1">
        <Path.Data>
            <EllipseGeometry Center="50,50" RadiusX="50" RadiusY="50" />
        </Path.Data>
    </Path>
</Button>

こちらのページでは、「Styleで同じようなことができるけど」と書いてありますが、いやいやいや。そうじゃないでしょう感が強いです。

WPFではこの問題は起きないようなのですが、はてさてどうしたものですかね。Silverlightが成熟して、こういうバグが根絶されることを望みます。