I have a windows phone runtime app and it tired to generate design time data using Expression Blend. The problem is that some of my classes nested classes and the design data will not compile. Here is a class that I am using to generate design time data.
public class stats
{
public class Pageviews
{
public int regular { get; set; }
public int threat { get; set; }
public int crawler { get; set; }
}
public class Uniques
{
public int regular { get; set; }
public int threat { get; set; }
public int crawler { get; set; }
}
public class TrafficBreakdown
{
public Pageviews pageviews { get; set; }
public bool estimated { get; set; }
public Uniques uniques { get; set; }
}
public class BandwidthServed
{
public double cloudflare { get; set; }
public double user { get; set; }
}
public class RequestsServed
{
public int cloudflare { get; set; }
public int user { get; set; }
}
public class Obj
{
public long cachedServerTime { get; set; }
public long cachedExpryTime { get; set; }
public TrafficBreakdown trafficBreakdown { get; set; }
public BandwidthServed bandwidthServed { get; set; }
public RequestsServed requestsServed { get; set; }
public bool pro_zone { get; set; }
public long currentServerTime { get; set; }
public int interval { get; set; }
public long zoneCDate { get; set; }
public string userSecuritySetting { get; set; }
public int dev_mode { get; set; }
public int ipv46 { get; set; }
public int ob { get; set; }
public string cache_lvl { get; set; }
public string outboundLinks { get; set; }
}
public class Result
{
public long timeZero { get; set; }
public long timeEnd { get; set; }
public int count { get; set; }
public bool has_more { get; set; }
public List<Obj> objs { get; set; }
}
public class Response
{
public Result result { get; set; }
}
public class RootObject
{
public Response response { get; set; }
public string result { get; set; }
public string msg { get; set; }
public string err_code { get; set; }
}
}
Here is the design time .xaml file.
<ViewModels:MainViewModel.Stats>
<Data:stats+Obj cache_lvl="Adipiscing nam phasellus" dev_mode="83" ipv46="75" interval="55" ob="47" outboundLinks="Parturient class aliquam vestibulum vestibulum" pro_zone="False" userSecuritySetting="Cras vestibulum curabitur">
<Data:stats+Obj.bandwidthServed>
<Data:stats+BandwidthServed cloudflare="500.26" user="349.37"/>
</Data:stats+Obj.bandwidthServed>
<Data:stats+Obj.cachedServerTime>
<System:Int64/>
</Data:stats+Obj.cachedServerTime>
<Data:stats+Obj.cachedExpryTime>
<System:Int64/>
</Data:stats+Obj.cachedExpryTime>
<Data:stats+Obj.currentServerTime>
<System:Int64/>
</Data:stats+Obj.currentServerTime>
<Data:stats+Obj.requestsServed>
<Data:stats+RequestsServed cloudflare="18" user="44"/>
</Data:stats+Obj.requestsServed>
<Data:stats+Obj.trafficBreakdown>
<Data:stats+TrafficBreakdown estimated="True">
<Data:stats+TrafficBreakdown.pageviews>
<Data:stats+Pageviews crawler="10" regular="41" threat="19"/>
</Data:stats+TrafficBreakdown.pageviews>
<Data:stats+TrafficBreakdown.uniques>
<Data:stats+Uniques crawler="99" regular="66" threat="39"/>
</Data:stats+TrafficBreakdown.uniques>
</Data:stats+TrafficBreakdown>
</Data:stats+Obj.trafficBreakdown>
<Data:stats+Obj.zoneCDate>
<System:Int64/>
</Data:stats+Obj.zoneCDate>
</Data:stats+Obj>
</ViewModels:MainViewModel.Stats>
It says the that stats+.Obj is not valid in a name. Anyone got any solutions?
Thanks in advance.
The first problem I see is that the
+
character is illegal in an XML name.EDIT: use the Design tab in Blend to generate the sample data from your class (just click the "Generate sample data from Class" in the Design tab and select your root class). Sample data I generated with your class: