The name does not exist in the name space

Shay Wilner 1,746 Reputation points
2020-08-27T19:13:57.69+00:00

Hi

In the xaml when i defined <DataTemplate x:DataType ="local:Classresult">

21031-namespace.png

and the classresult

Public Class Classresult
Public title As String
Public equation As New List(Of String)
End Class

Thanks

Developer technologies | Universal Windows Platform (UWP)

1 answer

Sort by: Most helpful
  1. Fay Wang - MSFT 5,231 Reputation points
    2020-08-28T01:51:42.62+00:00

    Hello,

    Welcome to Microsoft Q&A!

    First please check if the Classresult class is in the namespace of arithimetic, if it is, then the app should be able to build/run correctly even if it has line warning for its DataType. After you build/run the project, the warning will disappear. However, you need to add some elements to the DataTemplate first, otherelse, it will still throw exceptions.

    <ListView ......>
        <ListView.ItemTemplate>
            <DataTemplate x:DataType="local:Classresult">
                <StackPanel></StackPanel>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
    

    After it, build/run the project.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.