Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自定义windows 8网格应用程序模板中的每个项目_Windows_Grid - Fatal编程技术网

自定义windows 8网格应用程序模板中的每个项目

自定义windows 8网格应用程序模板中的每个项目,windows,grid,Windows,Grid,我想自定义Windows 8 Grid App中的一些项目,与默认模板不同,默认模板如下所示: SampleDataItem(字符串唯一ID、字符串标题、字符串字幕、字符串图像路径、字符串描述、字符串内容、SampleDataGroup组) 对于某些数据项,我想添加一些UI控件,如mediaElement或动画。对于其他人,我没有 有什么可能的办法来处理这样的问题吗 提前感谢。您需要为Base创建一个新的构造函数,以便使用新的自定义构造函数。像这样: public abstract class

我想自定义Windows 8 Grid App中的一些项目,与默认模板不同,默认模板如下所示:

SampleDataItem(字符串唯一ID、字符串标题、字符串字幕、字符串图像路径、字符串描述、字符串内容、SampleDataGroup组)

对于某些数据项,我想添加一些UI控件,如mediaElement或动画。对于其他人,我没有

有什么可能的办法来处理这样的问题吗


提前感谢。

您需要为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;
    }
}
现在,您需要将这个新构造函数调用到一个新的自定义类(或现有类)中,以填充网格项

  • 我的英语很差,对不起