i am getting this error after i try to binding using this code
(can anyone help me with this error?)
<Grid x:Name="ContentGrid" Margin="0,22,0,-22" Grid.Row="1">
<ListBox Height="444" HorizontalAlignment="Left" Margin="20,81,0,0" Name="listBox1" VerticalAlignment="Top" Width="434" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding username}" />
<TextBlock Text="{Binding password}" />
<TextBlock Text="{Binding gender}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
error
System.Windows.Data Error: BindingExpression path error: 'username' property not found on 'lim' 'System.String' (HashCode=339799040). BindingExpression: Path='username' DataItem='lim' (HashCode=339799040); target element is 'System.Windows.Controls.TextBlock' (Name=''); target property is 'Text' (type 'System.String')..
my whole project code
xaml code
<phone:PhoneApplicationPage
x:Class="Epromo.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True" >
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="83"/>
<RowDefinition Height="685*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TitlePanel" Margin="9,17,3,0"></StackPanel>
<Button Content="On going" HorizontalAlignment="Left" Margin="-5,85,0,0" VerticalAlignment="Top" Grid.RowSpan="2" Width="195"/>
<Button Content="most view" HorizontalAlignment="Left" Margin="161,85,0,0" VerticalAlignment="Top" Grid.RowSpan="2" Width="186" RenderTransformOrigin="0.5,0.5"/>
<Button Content="Coming soon" HorizontalAlignment="Left" Margin="321,85,-13,0" VerticalAlignment="Top" Grid.RowSpan="2" Width="170" FontSize="20" Height="72"/>
<Grid x:Name="ContentGrid" Margin="0,22,0,-22" Grid.Row="1">
<ListBox Height="444" HorizontalAlignment="Left" Margin="20,81,0,0" Name="listBox1" VerticalAlignment="Top" Width="434" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding username}" />
<TextBlock Text="{Binding password}" />
<TextBlock Text="{Binding gender}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Button Content="sign up" FontSize="17" Height="60" Name="signup" Width="120" Click="signup_Click" Margin="371,43,-11,647" Grid.RowSpan="2" />
<TextBlock x:Name="ApplicationTitle" Style="{StaticResource PhoneTextNormalStyle}" FontSize="24" FontFamily="Times New Roman" Height="34" Margin="4,0,32,49">
<Run Text="Epromo" /></TextBlock>
</Grid>
</phone:PhoneApplicationPage>
cs code
using Epromo.ServiceReference1;
namespace Epromo
{
public partial class MainPage : PhoneApplicationPage
{
private Service1Client _serviceClient;
public MainPage()
{
InitializeComponent();
Loaded += new RoutedEventHandler(Post_Loaded);
}
void Post_Loaded(object sender, EventArgs e)
{
_serviceClient = new Service1Client();
_serviceClient.ListPostCompleted += new EventHandler<ListPostCompletedEventArgs>(getList_Completed);
_serviceClient.ListPostAsync();
}
void getList_Completed(object sender, ListPostCompletedEventArgs e)
{
listBox1.ItemsSource = e.Result;
}
private void signup_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/signupPage.xaml", UriKind.Relative));
}
}
}