自定义控件(按钮)元素已经是另一个元素的子元素

时间:2014-04-05 09:27:38

标签: silverlight silverlight-4.0 silverlight-5.0

添加此资源时

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Viewbox x:Key="SpecialAddIcon">
    <Grid>
        <Grid Name="backgroundGrid" Width="48" Height="48" Visibility="Visible">
            <Rectangle Fill="#FF000000" Name="Rect" Visibility="Visible" />
        </Grid>
        <Path Data="M19.833,0L32.5,0 32.5,19.833999 52.334,19.833999 52.334,32.500999 32.5,32.500999 32.5,52.333 19.833,52.333 19.833,32.500999 0,32.500999 0,19.833999 19.833,19.833999z" Stretch="Uniform" Fill="#FFFFFFFF" Width="26" Height="26" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
            <Path.RenderTransform>
                <TransformGroup>
                    <TransformGroup.Children>
                        <RotateTransform Angle="0" />
                        <ScaleTransform ScaleX="1" ScaleY="1" />
                    </TransformGroup.Children>
                </TransformGroup>
            </Path.RenderTransform>
        </Path>
    </Grid>
</Viewbox>

发生此错误

&#34;元素已经是另一个元素的孩子。&#34;

0 个答案:

没有答案