Cannot use list element's property!

I am trying to use a property of a list element, but it won’t let me!
I am using a list (called myList) of type. This type can be used for file information.

This File type has a property called Name, and you can get the file’s name.
I can do the following:

For Each item (of type in myList: {
Write Line: item.Name

This works perfectly, and it prints the name of all files stored in myList. By the way, this Name property is string type.

Now, I want to use lambda expression to retrieve elements whose file name contains “test”. I want to do something like

myList.Select(Function (x) x.Name.Contains(“test”))

but the program won’t let me!

Why won’t IntelliSense show Name property?? I manually typed it, but it has a compile error. I am confused.

myList is a list of

Give a try and write the Statement blindly. Sometimes Intellisense hangs.
Check that is correctly imported


Verify following:

maybe play with myList.AsEnumerable…

In case you receive any validation error then post some screenshot of it here.

Happy Coding

1 Like

Thank you! I had already included the namespace in the “Imports” tag, but it was not working. But when I opened the .xaml file, and manually included the namespace (which had not been included!), it started working.

Unfortunately, the IntelliSense still won’t pull up the property, the error icon disappears when I typed the property name.

Thank you :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.