I have a list of data which is bind to a combobox, so each item in combobox has three different set of data. Here is my data:
Private Class PhotoType
Public Property FrameDimension() As Integer()
Public Property InnerFrameMargin() As Integer() '{top, bottom, left, right}
Public Property InnerFramePosition() As Integer() '{xpos, ypos}
Public Property PhotoData() As List(Of Integer())
End Class
Public Function PhotoList()
Dim listPhoto As New List(Of PhotoType) From {
'------------ Item 1 --------------
New PhotoType With {
.FrameDimension = {60, 90},
.InnerFrameMargin = {10, 30, 10, 10},
.InnerFramePosition = {5, -5}},
'------------ Item 2 --------------
New PhotoType With {
.FrameDimension = {60, 90},
.InnerFrameMargin = {5, 5, 5, 5},
.InnerFramePosition = {5, -5}}
}
PhotoList = listPhoto
End Function
On my code behind, here is my code:
Private Sub DockerPolaroid_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
With cb_layout
.SelectedValuePath = "PhotoData"
.ItemsSource = ClsData.PhotoList
End With
End Sub
So I need to merge three arrays into one data so they can be put in SelectedValuePath in the code behind WPF form. I made a list variable called photodata
to hold all those data, but I'm not sure what's the right approach for this. Should I just store the data in one array for this to work?