C# 为什么我的列表框不显示任何数据?
这是我的XAML,在windows phone中,我正在使用MVVM将数据设置到页面,但在列表框中找不到任何数据C# 为什么我的列表框不显示任何数据?,c#,mvvm,windows-phone,C#,Mvvm,Windows Phone,这是我的XAML,在windows phone中,我正在使用MVVM将数据设置到页面,但在列表框中找不到任何数据 <ListBox Grid.Row="0" SelectionMode="Single" SelectedItem="{Binding CurrentSelectedEmployee, Mode=TwoWay}"> <ListBox.ItemTemplate> <DataTemplate> <
<ListBox Grid.Row="0" SelectionMode="Single" SelectedItem="{Binding CurrentSelectedEmployee, Mode=TwoWay}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding FirstName}"></TextBlock>
<TextBlock Width="5"></TextBlock>
<TextBlock Text="{Binding LastName}"></TextBlock>
</StackPanel>
<TextBlock Text="{Binding Description}" TextWrapping="Wrap"></TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
但我在第页找不到任何细节!,原因可能是什么?您尚未为列表框的ItemsSource属性分配任何值 在您的XAML中
<ListBox Grid.Row="0" ItemsSource="{Binding Employees}"
SelectionMode="Single" SelectedItem="{Binding CurrentSelectedEmployee, Mode=TwoWay}">
您尚未为列表框的ItemsSource属性分配任何值 在您的XAML中
<ListBox Grid.Row="0" ItemsSource="{Binding Employees}"
SelectionMode="Single" SelectedItem="{Binding CurrentSelectedEmployee, Mode=TwoWay}">
不要将“OnpropertyChanged()”留空;“使用OnpropertyChanged(“员工”)而不是将“OnpropertyChanged()”留空;“改用OnpropertyChanged(“员工”)
<ListBox Grid.Row="0" ItemsSource="{Binding Employees}"
SelectionMode="Single" SelectedItem="{Binding CurrentSelectedEmployee, Mode=TwoWay}">