tags:

views:

92

answers:

1

In my presenter I have this property:

public List<string> PropertyNames { get; set; }

And I want to list out the names with a ItemsControl/DataTemplate like this:

<ItemsControl ItemsSource="{Binding PropertyNames}">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Value}"/>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

Since the generic list doesn't have named properties, how do I reference the value in my Binding statement?

+5  A: 

let me answer this, it's just {Binding}.

Edward Tanguay
+1. Yeah. I confused it with `Path=...` where dot works.
Mehrdad Afshari
FYI, '.' works either with or without 'Path='. Blank is implicitly interpreted as a '.'. So you can write {Binding}, {Binding .}, or {Binding Path=.} Note that {Binding Path=} won't work - you'll get a XAML compiler error.
Kent Boogaart