Thanks for the reply. Here is a simplified version of my code:
xaml (in file MainWindow.xaml)
Many thanks for helping me out!
xaml (in file MainWindow.xaml)
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="800" Width="525" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit">
<Grid>
<xctk:CollectionControl Height="240"
HorizontalAlignment="Left"
Name="CollectionControl1"
VerticalAlignment="Top"
Width="479"
>
</xctk:CollectionControl>
</Grid>
</Window>
code behind (in MainWindow.xaml.vb)Class MainWindow
Public Sub New()
' This call is required by the designer.
InitializeComponent()
Dim MaterialCollection As List(Of clsMaterial) = New List(Of clsMaterial)
MaterialCollection.Add(New clsMaterial(93.0, 94.0))
CollectionControl1.DataContext = MaterialCollection
CollectionControl1.ItemsSource = MaterialCollection
CollectionControl1.NewItemTypes = New List(Of System.Type)() From {GetType(clsMaterial)}
End Sub
End Class
Class to be displayed in CollectionEditor (in file clsMaterial.vb):Imports System.ComponentModel
Public Class clsMaterial
Public Overrides Function ToString() As String
Return Convert.ToString("This is a string")
End Function
Public myLWEmissivityOut As Double
Public myLWEmissivityIn As Double
Public Sub New()
myLWEmissivityOut = 0.0
myLWEmissivityIn = 0.0
End Sub
Public Sub New( _
ByVal newLWEmissivityOut As Double,
ByVal newLWEmissivityIn As Double
)
myLWEmissivityOut = newLWEmissivityOut
myLWEmissivityIn = newLWEmissivityIn
End Sub
Public Property LWEmissivityOut() As Double
Get
Return myLWEmissivityOut
End Get
Set(ByVal value As Double)
myLWEmissivityOut = value
'ToString()
End Set
End Property
Public Property LWEmissivityIn() As Double
Get
Return myLWEmissivityIn
End Get
Set(ByVal value As Double)
myLWEmissivityIn = value
End Set
End Property
End Class
Note, My code will not step into the ToString function unless I force it, (see commented out line in Set LWEmissivityOut property). Even then I don't see "This is a string" appear in the ListBox.Many thanks for helping me out!