在上下文菜单中使用本地化资源时出现XAML错误

时间:2013-12-31 20:32:30

标签: xaml windows-phone-8 contextmenu

我有以下代码:

<ListBox x:Name="FavList">
<ListBox.ItemTemplate>
    <DataTemplate>
        <Grid>
            <Button x:Name="PlayPause" Style="{StaticResource IconButton}" HorizontalAlignment="Left" Margin="2,2,0,2" Width="72" Click="PlayPause_Click" BorderThickness="0">
                <ImageBrush x:Name="PlayPauseImage" ImageSource="Assets\Images\Play.png" />
            </Button>
            <TextBlock x:Name="myStreamName" Margin="84,8,8,0" TextWrapping="Wrap" Text="{Binding Name, FallbackValue='Test'}" Height="29" VerticalAlignment="Top" FontSize="20" FontWeight="Bold"/>
            <TextBlock x:Name="myStreamDescription" Margin="84,37,8,8" TextWrapping="Wrap" Text="{Binding About, FallbackValue='Testing'}" FontSize="16"/>
            <TextBlock x:Name="myStreamURL" Text="{Binding URL}" Visibility="Collapsed" />
            <toolkit:ContextMenuService.ContextMenu>
                <toolkit:ContextMenu>
                    <toolkit:MenuItem x:Name="DeleteFavorite" Header="{Binding Path=LocalizedResources.DeleteFavButton, Source={StaticResource LocalizedStrings}}"  Click="DeleteFavorite_Click" />
                </toolkit:ContextMenu>
            </toolkit:ContextMenuService.ContextMenu>
        </Grid>
    </DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

当我的MenuItem标题与我现在的标题相同时,我一直收到无效的XA​​ML错误。当我只是输入header =“删除”一切都很好。

为什么会发生这种情况?

0 个答案:

没有答案