MVVM に基づく WPF プロジェクトがあります。私の見解では、次の ListBox があります
<ListBox BorderBrush="#6797c8" BorderThickness="2"
ItemsSource="{Binding Path=CategoriesDS}"
DisplayMemberPath="MainCategories/Category"/>
そして、これはViewModelでの私のコードです:
private DataSet categoriesDS;
public DataSet CategoriesDS
{
get
{
if (categoriesDS == null)
{
categoriesDS = _dal.GetCategoriesTables();
}
return categoriesDS;
}
set
{
categoriesDS = value;
if (this.PropertyChanged != null)
{
this.PropertyChanged(this,
new PropertyChangedEventArgs("CategoriesDS"));
}
}
}
私の DataSet には 2 つのテーブルが含まれており、最初のテーブル (「MainCategories」) には 3 つの行が含まれています。アプリを実行すると、「MainCategories」テーブルの最初の行だけが表示されます。
ListBox に 1 行しか表示されないのはなぜですか? テーブル全体を表示したい。
ありがとう