Overrided ToString doesn't show in debug

Posted by marco.ragogna on Stack Overflow See other posts from Stack Overflow or by marco.ragogna
Published on 2010-04-07T09:40:30Z Indexed on 2010/04/07 9:43 UTC
Read the original article Hit count: 210

Filed under:
|
|

I have a collection similar to:

Public Class MyCollection
    Inherits ObservableCollection(Of MyCollection)

    Private _Name As String

    Public Property Name() As String
        Get
            Return _Name
        End Get
        Set(ByVal value As String)
            _Name = value
        End Set
    End Property

    Public Overrides Function ToString() As String
        Return "Name: " & _Name
    End Function

End Class

I have overrided ToString method in order to help in debug, but it doesn't show up.

In the code that follow if, during debug, I move the mouse over coll it shows me Count = 0

Private Sub Window1_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded    
        Dim coll As New MyCollection    
        coll.Name = "Test"        
    End Sub

Do you know what could be the problem?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about vb.net