Blend cannot generate sample data for many intrins

2019-07-25 11:42发布

It looks like Blend (2015) cannot generate sample values for certain data types. The types that failed for me include short and byte. The types that generated sample values are string, int and bool. Has anyone else experienced it and is there a workaround for this limitation?

Example:

The following class doesn't generate correct sample data:

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

Sample data looks like (notice there are no sample values):

<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>

But if simply change the data type of these properties to int:

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

The sample data looks like:

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

1条回答
姐就是有狂的资本
2楼-- · 2019-07-25 11:52

I have noticed the same thing. You can manually edit the generated sample data and add values yourself.

查看更多
登录 后发表回答