ComboBox
VB.Net WPF アプリケーションを使用しています。
<ComboBox HorizontalAlignment="Left" Margin="77,49,0,0" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Path=Server.RecipeList()}" DisplayMemberPath="RecipeID" SelectedValuePath="RecipeID"/>
コード ビハインドには、Server というクラス変数があります。
Public Server As BatchServer = New BatchServer
私の Server オブジェクトには、次のものがありますList
。
Private mRecipeList As New List(Of Recipe)
そして、サーバーのデフォルトのコンストラクターは
Public Sub New()
Server = New BatchRemote.RemoteSupport
PopulateRecipeList()
End Sub
List
これをにバインドしたいComboBox
ので、リスト内の各レシピの RecipeID を表示する必要があります。私のデータ バインディングは最初のコード ブロックと同じように見えますが、アプリケーションを実行するとComboBox
は常に空になります。
ここで何が間違っていますか?