Friday, 23 August 2013

Binding with Datatemplate member

Binding with Datatemplate member

I have a data template like this
public class DefaultDataTemplate : DataTemplate
{
public string Name
{
get;
set;
}
}
and I am using in xaml like this
<!-- Default DataTemplate -->
<DataTemplate x:Key="DefaultDataTemplate">
<Grid Margin="4" MinHeight="25">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}" FontWeight="Bold" />
</Grid>
</DataTemplate>
I want to do binding with the Name Property of my datatemplate ,but right
now its binded to my List view item's property Name.Can anybody help for
the correct way or syntax

No comments:

Post a Comment