ITemplate |
While developing a custom code (be it an indicator or a strategy or a chart object etc) user may declare one or more custom property. User can configure those user defined properties from the GUI itself by building Xaml templates. This Xaml templates are available in the properties view of the SharpScript object. For example in case of an Indicator the properties can be edited from the Indicator Selector View. Drawing Objects properties can be edited by simply double clicking on the drawing object which will display the Properties view of the Drawing Object.
ArthaChitra is built on Windows Presentation Foundation (WPF), using the Model-View-ViewModel (MVVM) design pattern. The basic of WPF and MVVM architecture is about separating the View/User Interface (UI) and the actual business logic. Since the views are independent of the business logic, it gives immense flexibility to design the views (using Xaml templates).
A SharpScript code 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.
For example if you have an Indicator, called HolyGrail, and you have a corresponding Xaml template for it named as say, HolyGrailIndicator
<DataTemplate x:Key="HolyGrailIndicator"> <!-- design your template here --> </DataTemplate>
In the custom code user can point to the template by simply overriding the Template property.
public override object Template { get { return "HolyGrailIndicator" } }
Some of the default namespaces internal to ArthaChitra are as follows:
xmlns:controls="clr-namespace:ArthaChitra.Core.Controls;assembly=ArthaChitra.Core" xmlns:common="clr-namespace:ArthaChitra.Model.Common;assembly=ArthaChitra.Core" xmlns:order="clr-namespace:ArthaChitra.Model.Order;assembly=ArthaChitra.Core" xmlns:data="clr-namespace:ArthaChitra.Model.Data;assembly=ArthaChitra.Core"
The Xaml templates can be found in the folder <My Documents>/ArthaChitra 2/Xaml Resources/