Click or drag to resize

ITemplate

A SharpScript code may implements the ITemplate interface. The ITemplate interface lets the user to choose the Xaml file which he intends to use to edit the properties in the properties view of the SharpScript class.

Default template name

The default xaml template name for different SharpScript objects are:

Indicator<class name> + Indicator
Strategy<class name> + Strategy
BarType<class name> + BarType
ChartStyle<class name> + ChartStyle
Scanner<class name> + Scanner
ChartObject<class name> + ChartObject
Perforance<class name> + Performance
External Options<class name> + ExternalOptions

For example if you have an Indicator, called HolyGrail, and you have a corresponding Xaml template for it, then the template will be named as HolyGrailIndicator

XAML
<DataTemplate x:Key="HolyGrailIndicator">
  <!-- design your template here -->
</DataTemplate>
Overriding default template name

If the user defined xaml dataTemplate does not have the default name (e.g. 2 (two) codes pointing to same template) then user can override the TemplateType and the Template property to target the desired template.

public override TemplateType TemplateType
{
     get 
     {
         return Common.TemplateType.UserDefined; 
     }
}

public override object Template
{
    get
    {
        return "name of the custom xaml dataTemplate"
    }
}
See Also

Reference

Other Resources