XAML不正确,为什么? [英] Incorrect XAML, why?

查看:138
本文介绍了XAML不正确,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在开发一个简单的应用程序,或者更好,我开发了一个简单的应用程序,一切正常,但我不知道为什么在VS2010中这段代码被标记为不正确的XAML当我在设计器上打开页面时。

我再说一遍,一切正常,编译和部署,但设计师说XAML中有一些错误



这是代码,任何想法?



Hi everyone, I''m devoliping a simple app,or better, I''ve developed a simple app, it all works fine, but I don''t know why in VS2010 this piece of code is marked as "incorrect XAML" when I open the page on the designer.
I repeat, it all works fine, compile and Deploy, but the designer says there''s some errors in XAML

Here''s the code, any idea?

<Grid x:Name="LayoutRoot">
        <ListBox Height="499" HorizontalAlignment="Left" Name="lstPeople" VerticalAlignment="Top" Width="480" SelectionChanged="lstPeople_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel x:Name="stackPanelPeopleList" Orientation="Vertical" >
                        <TextBlock HorizontalAlignment="Left" Foreground="{StaticResource PhoneForegroundBrush}" FontSize="30" Text="{Binding Nome}"/>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                            <TextBlock Margin="0,0,10,0" FontSize="25" Text="{Binding Path=LocalizedResources.QuotaLabel, Source={StaticResource LocalizedStrings}}" Foreground="LightBlue"/>
                            <TextBlock Margin="0,0,10,0" FontSize="25" Text="{Binding QuotaVersata}" Foreground="{StaticResource PhoneForegroundBrush}"/>
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>        
    </Grid>





问题似乎出现在< datatemplate>标记和之后的所有行...



The problems appears to be in <datatemplate> tag and all the lines after that...

推荐答案

当您在单独的资源字典中使用静态资源时,通常会发生这种情况。

我不确定为什么视觉工作室会抱怨它。



有时我设法通过清理项目来解决它,并在某些情况下删除bin和obj文件夹。



大多数情况下,我只是设置了设计器并继续运行,让编译器告诉你它是否坏了。
This usually happens when you use Static Resources in seperate resource dictionaries.
I am not exactly sure why visual studio has a moan about it.

Sometimes I have managed to get around it by cleaning the project, and in some situations removing the bin and obj folders.

Most of the time though, I just set the designer off and carry on and let the compiler let you know if its broken.


这篇关于XAML不正确,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆