【发布时间】:2018-12-15 06:57:29
【问题描述】:
我在 XAML (MainPage.xaml) 中声明 ListView:
<ListView x:Name="ShoppingListsLV"
HorizontalOptions="CenterAndExpand"
Margin="3"/>
并尝试从我的代码 (MainPage.xaml.cs) 中访问它:
ShoppingListsLV.ItemsSource = new string[] { "test", "test 2"};
我有一个错误:
CS0103:名称 ShoppingListsLV 在当前上下文中不存在
【问题讨论】:
-
有时会出现,不知道实际路由原因,尝试重新打开VS并新建控件
-
也在这里查看-->stackoverflow.com/questions/706603/…