Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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?

XML
<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>


The problems appears to be in <datatemplate> tag and all the lines after that...
Posted
Comments
Christian Amado 7-Dec-12 6:33am    
Are you using any third-party control on your Silverlight Project?

1 solution

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.
 
Share this answer
 
Comments
IndifferentDisdain 11-Jan-13 16:51pm    
Yep, I get that all the time. VS2012 seems to do a lot better job at that, though it has its own oddities like losing references in IntelliSense to classes/methods in other namespaces. So, for a while, I'd work on one solution with both VS2010 and 2012 simultaneously. So much fun.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900