这是我正在使用的代码:
private static WeightRecordsDataSource sharedDataSource;
public static WeightRecordsDataSource SharedDataSource
{
get
{
if (sharedDataSource == null)
sharedDataSource = new WeightRecordsDataSource();
return sharedDataSource;
}
}
但是,每次调用SharedDataSource,都会发现sharedDataSource为null!因此WeightRecordsDataSource
调用了一个新的。我究竟做错了什么?