I bought the CSLA 4.0 MVVM Serials, and according to the sample, i set up a ProductCategoryViewModel, and ProductCategoyrView , in the ProductcategoryView there a combox for parent product category, how to bind the ProductCategorListViewModel to the combox itemsource?
Thank you.
Hi
this is what I've done (binding to namevaluelsit)
<custom:AutoCompleteComboBox x:Name="cboKeywordSearch" Width="200" Margin="10" MaxDropDownHeight="1000"
SelectedValue="{Binding Path= Model.KeywordID,Mode=TwoWay}
SelectedValuePath="Value" SelectedValue="{Binding Path= KeywordSearch,Mode=TwoWay}"
ItemsSource="{Binding KeywordList, ValidatesOnDataErrors=true, Mode=TwoWay}">
HTH
Richard
Hi Richard
How to get the keywordList ? use :CslaDataProvider?
In my project, I use the code as below, but not work..
<CollectionViewSource x:Key="productCategorySource" Source="vm:ProductCategoryViewModel" />
<CollectionViewSource x:Key="productCategoryListSource"Source="vm:ProductCategoryListViewModel" />
This is in my VM:
Private _KeywordList As Abraca.Business.KeywordNVL
Public Property KeywordList() As Abraca.Business.KeywordNVL
Get
If _KeywordList Is Nothing Then
LoadKeywordList()
End If
Return _KeywordList
End Get
Set(ByVal value As Abraca.Business.KeywordNVL)
_KeywordList = value
OnPropertyChanged("KeywordList")
End Set
End Property
Private Sub LoadKeywordList()
Abraca.Business.KeywordNVL.GetBySchoolIDAsync(App.SchoolID, AddressOf LoadKeywordListCompleted)
End Sub
Private Sub LoadKeywordListCompleted(ByVal sender As Object, ByVal e As Csla.DataPortalResult(Of Abraca.Business.KeywordNVL))
If Not e.Object Is Nothing Then
KeywordList = e.Object
Else
MessageBox.Show(e.Error.Message, "Error getting subject index list", MessageBoxButton.OK)
End If
End Sub
My combo binds to KeywordList
Richard
Copyright (c) Marimer LLC