ATAS X and macOS
ATAS X is the cross-platform version of the platform for Windows and macOS. The classic ATAS is built on WPF; ATAS X uses cross-platform technologies, so an extension assembly must meet a few extra rules. In most cases a single build for the classic ATAS runs in ATAS X as it is.
One build for both platforms
Build the extension as usual, for the classic ATAS (net10.0-windows, AnyCPU), and install the same DLL into both
platforms. At load time ATAS X converts the Windows types the API uses to their cross-platform counterparts:
System.Windows.Media.ColorandColors;System.Windows.Input.KeyandKeyEventArgs;System.Windows.Point;System.Drawing.SolidBrush,PenandFont.
Nothing else is converted. ATAS X does not load an assembly that uses any other type of the WPF libraries
(WindowsBase, PresentationCore, PresentationFramework): SolidColorBrush, Rect, Dispatcher,
MessageBox, controls and windows, or that references System.Xaml. One such type anywhere in the assembly is
enough for the whole file to be skipped, with a warning in the platform log:
Rejected assembly: Indicator 'MyIndicator.dll' at file MyIndicator.dll cannot be used on cross-platform. It uses WPF types that have no cross-platform equivalent: System.Windows.Media.SolidColorBrush. Please use a version of this indicator that does not use WPF UI.
Instead of WPF brushes, draw with the platform API: the RenderContext methods take a System.Drawing.Color, and a
System.Windows.Media.Color from the settings is converted with the Convert() extension method of
ATAS.Indicators (see Drawing). For text, prefer the font of the chart
(ChartInfo.PriceAxisFont) or a font that exists on both Windows and macOS.
Custom editors
Custom property editors written as WPF controls are not converted, so an assembly with them is loaded by the classic
ATAS only. ATAS X supports custom editors written as Avalonia controls, declared with the same
System.ComponentModel.EditorAttribute:
- on a property (or on the type of its value): the control replaces the editor of that row in the settings grid; its
DataContextis the value of the property; - on the class: the control replaces the whole generated settings page; its
DataContextis the extension instance.
WPF and Avalonia editors cannot coexist in one build, so an extension with custom editors is built per platform: the
classic build with the WPF editors, the cross build (net10.0, Platform=Cross) with the Avalonia editors, the
extension code shared. The Samples project of the
official indicators repository shows the complete setup: the editors in Editors/Wpf (*.xaml) and
Editors/Avalonia (*.axaml) sharing one namespace, SampleCustomEditorsIndicator with per-property editors,
SampleCustomViewIndicator with a whole custom settings view, and a project file that picks the editors folder per
platform (dotnet build for the classic ATAS, dotnet build /p:Platform=Cross for ATAS X).
Installing and reloading
The Add custom indicator button of the indicators window installs a DLL at once on Windows and macOS, without
knowing the folder. Copied by hand, the DLL goes to %AppData%\ATAS X\Indicators on Windows or
~/Library/Application Support/ATAS/Indicators on macOS (or the Extensions folder next to it); ATAS X watches the
folders and loads a new or changed file by itself about a second after the files stop changing, with a notification
of the result. The folders of every extension kind are listed in
Project setup.
Building on macOS
Reference the assemblies inside the application bundle: ATAS X.app/Contents/MonoBundle/,
for a default install /Applications/ATAS X.app/Contents/MonoBundle/ (in Finder, right-click the app and choose
Show Package Contents). To debug, use a debugger that can attach to the ATAS X process, for example JetBrains
Rider.
Distribution
Upload a single classic build to the Personal Area, one module registration: a module stores one file, both the classic ATAS and ATAS X download it, and ATAS X adapts it at load time. ATAS X does not install a downloaded module that uses WPF types it cannot convert (for example, custom WPF editors) and writes a warning to the log, so such a module works in the classic ATAS only.
Troubleshooting
If the extension does not appear in ATAS X, look in the platform log for a Rejected assembly warning: it names the
WPF types that prevent the assembly from loading. A file rejected this way is not listed in the notification about
the updated extensions. If the extension uses no such types and still does not work, contact the technical support
with the DLL or the source code.