From microsoft.com (via StackOverflow):

In order to be able to be instantiated as an object element, your class must meet the following requirements:

  • Your custom class must be public and support a default (parameterless) public constructor. (See following section for notes regarding structures.)

  • Your custom class must not be a nested class. Nested classes and the "dot" in their general CLR usage syntax interfere with other WPFย and/or XAML features such as attached properties.

[emphasis is mine]

That's got to be a joke, right? So I can't use a "nested class" (which would include anything with a java-style like com.yourCo.namespace) like this to create a ListView item template?

<ListView Grid.Row="1" Grid.RowSpan="1"
            Name="lstEps"
            IsItemClickEnabled="True">
    <ListView.ItemTemplate>


        <DataTemplate x:DataType="PodcastersFeed.Entities.EpCapsule"><!-- <<< No can haz namespace!! -->


            <Grid>
                <Border Background="LightGray" Height="30" Width="250">
                    <TextBlock
                        Text="{x:Bind Title}"
                        FontSize="18"
                        Foreground="Green"/>
                </Border>
            </Grid>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

Look, that's crazy-insane. I'd also had trouble with "namespaced" UserControls I'd created in the past, and lucked into figuring out they'd only work for me when I took them "out" of the non-local namespace, but figured I was doing something wrong. Maybe not.

Wow. I've made a wrapper class in my local namespace as a shuttle.

UWP unfortunately remains a hacky place.

Labels: , ,