Can't get local XAML item working

Oct 11, 2012 at 7:50 PM

Hi,

I'm having real trouble getting local XAML to work on a 7.1 App.  I've tried everything, including pasting the sample in to my app.  This is my user control as it stands at the moment (tried to make it as simple as I could):

<UserControl x:Class="Wibble.TestControl"
    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"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    
    <Grid x:Name="LayoutRoot">
        <TextBlock Text="WOO HOO!"/>
    </Grid>
</UserControl>

and this is what I've got in Data.xml:

    <Item Title="test" Type="xaml">
      <my:TestControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:my="clr-namespace:Wibble;assembly=Wibble"
        HorizontalAlignment="Stretch"
        VerticalAlignment="Top" />
    </Item>
No matter what I try, including grabbing the sample, removing the code-behind file and everything I can think of.  I don't get an error (that I can see), only the "test" header with no content (blank beneath the title).  All the other pages defined in data.xml work fine.
Can anyone tell me what I'm doing wrong please?
Cheers,
Andy
Oct 15, 2012 at 4:53 PM

Replying to my own message.  In a fit of frustrationI copied my XAML content to notepad, deleted my XAML user control, recreated it and pasted back in the XAML.

After this it just worked.  Therefore I guess that Visual Studio had got confused somewhere, or more likely, I'd misclicked something and messed up the build action (or something similar).

I'm now struggling to get a ListBox within that control to scroll, but that's another discussion post I think!

Andy