ViewModelGenerator.tt contains following code for SvgTextBase-detection:
var svgTextBase = svgElement as SvgTextBase;
if (svgTextBase != null)
{
#>
public virtual string <#= safeMemberName #>
{
get
{
return this.GetText("<#= memberName #>");
}
set
{
this.SetText("<#= memberName #>", value);
}
}
<#
} // svgTextBase
This detection should also cope with some primitive types (ie DateTime and int, float, ...), to transpose the responsibility of formatting to Svg.Contrib.Render.ViewModel.
Therefore, following XML attributes should be used:
data-type must define the type of the property
string (default)
date
number
data--date-format (optional) may contain placeholders, as mentioned in:
ViewModelGenerator.tt
contains following code forSvgTextBase
-detection:This detection should also cope with some primitive types (ie
DateTime
andint
,float
, ...), to transpose the responsibility of formatting toSvg.Contrib.Render.ViewModel
.Therefore, following XML attributes should be used:
data-type
must define the type of the propertystring
(default)date
number
data--date-format
(optional) may contain placeholders, as mentioned in:data--number-type
must define the concrete type of the numberint
as the defaultdata--number-format
(optional) may contain placeholders, as mentioned in:Additionally, view model classes must contain a
CultureInfo
-property (cf resources culture):