问题
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:
I have noticed the same thing. You can manually edit the generated sample data and add values yourself.
来源:https://stackoverflow.com/questions/37096781/blend-cannot-generate-sample-data-for-many-intrinsic-types