为什么我通过下面的代码粗体显示此错误?
使用实例引用无法访问成员
IocContainer.ShowWeatherDetailViewModel
(和IocContainer.ShowWeatherViewModel
);用类型名称来限定它。错误代码:CS0176
public class IocContainer
{
public static IocContainer Ioc
{
get { return App.Current.Resources["ioc"] as IocContainer; }
}
// Some other static properties.
// static constructor
}
IocContainer.Ioc.ShowWeatherDetailViewModel.Item = IocContainer.Ioc.ShowWeatherViewModel.SelectedVillage;
答案 0 :(得分:0)
我通过将//Repopulate your adapter
this.adapterListView.populate(rs)
和listView.setAdapter(new AdapterListView(getActivity(), rs));
设为实例属性来找到它。
感谢@JonSkeet和@ChrisShain。