Blend无法为许多内在类型生成样本数据

时间:2016-05-08 06:03:46

标签: c# visual-studio xaml blend

看起来Blend(2015)无法为某些数据类型生成样本值。对我失败的类型包括shortbyte。生成样本值的类型为stringintbool。有没有其他人经历过这种限制的解决方法?

示例:

以下课程不会生成正确的样本数据:

public partial class PointLocation
{
    public byte Number { get; set; }
    public short X { get; set; }
    public short Y { get; set; }
}

示例数据看起来像(注意没有样本值):

<VM:PointLocation>
    <VM:PointLocation.Number>
        <System:Byte/>
    </VM:PointLocation.Number>
    <VM:PointLocation.X>
        <System:Int16/>
    </VM:PointLocation.X>
    <VM:PointLocation.Y>
        <System:Int16/>
    </VM:PointLocation.Y>
</VM:PointLocation>

但是,如果只是将这些属性的数据类型更改为int

public partial class PointLocation
{
    public int Number { get; set; }
    public int X { get; set; }
    public int Y { get; set; }
}

示例数据如下所示:

<VM:PointLocation Number="79" X="30" Y="68" />

1 个答案:

答案 0 :(得分:0)

我注意到了同样的事情。您可以手动编辑生成的样本数据并自行添加值。