DependencyObject Array C # for VB.NET

I have a DependencyObject in C # that is being used on an array. Example shown below:

private KeywordTag[] tags = new KeywordTag[] {
    new KeywordTag { Tag = "test", IncidenceCount = 2076 },
    new KeywordTag { Tag = "oi", IncidenceCount = 2052 },
    new KeywordTag { Tag = "hmm", IncidenceCount = 1887 },
    new KeywordTag { Tag = "grr", IncidenceCount = 1414 },
    new KeywordTag { Tag = "thanks", IncidenceCount = 1166 }}

      

How do I convert this code to VB.NET?

Thank!

0


source to share


2 answers


the dummy answer was almost right, VB.Net syntax has "WITH" after constructors.



Private tags() As KeywordTag = { _
    New KeywordTag() WITH {.Tag = test", .IncidentCount = 2076}, _
    New KeywordTag() WITH {.Tag = "oi", .IncidentCount = 2052}, _
    New KeywordTag() WITH {.Tag = "hmm", .IncidentCount = 1887}, _
    New KeywordTag() WITH {.Tag = "grr", .IncidentCount = 1414}, _
    New KeywordTag() WITH {.Tag = "thanks", .IncidentCount = 1166} _
    }

      

+3


source


Something like:



Private tags() As KeywordTag = { New KeywordTag { Tag = "test", IncidenceCount = 2076 }, New KeywordTag { Tag = "oi", IncidenceCount = 2052 }, New KeywordTag { Tag = "hmm", IncidenceCount = 1887 }, New KeywordTag { Tag = "grr", IncidenceCount = 1414 }, New KeywordTag { Tag = "thanks", IncidenceCount = 1166 }}

      

+2


source







All Articles