您需要为 Base 创建一个新的构造函数以使用新的自定义构造函数。像这样:
public abstract class SampleDataCommon : PrototypeCeA.Common.BindableBase
{
private static Uri _baseUri = new Uri("ms-appx:///");
//Base constructor
public SampleDataCommon(String uniqueId, String title, String subtitle, String imagePath, SolidColorBrush Background)
{
this._uniqueId = uniqueId;
this._title = title;
this._subtitle = subtitle;
this._imagePath = imagePath;
this._background = Background;
}
// new customized constructor
public SampleDataCommon(String uniqueId, String title, String subtitle, bitmapImage image, String description, String Author)
{
this._uniqueId = uniqueId;
this._title = title;
this._subtitle = subtitle;
this._description = description;
this._image = image;
this._author = author;
}
}
现在,您需要将此新构造函数调用到一个新的自定义类(或现有类)中以填充您的网格项。