The applications moved every host into a folder of its own, so the projects the from-source samples reference
are under Xaml\Avalonia and Xaml\Wpf now, and the FIX connector they named lives in the public connectors
repository. Nine WPF samples still named Xaml and Xaml.Charting where they were before: a missing project
reference is only a warning, so they failed later, at the first DevExpress or StockSharp tag of their markup.
The MultiConnect samples sign in through the window the WPF head has. That head keeps the credentials window
in Studio.WebApi.UI, taking the site's client service; the samples asked StockSharp.Xaml for one taking a
fetcher, which the head does not have, and did not compile from sources. The published UI packages are far
behind the sources and are not what the samples are kept in step with: the package-based projects of these
samples compile once the WPF packages built from that head are published.
The WPF samples await the connector's settings window, which the WPF library offers as ConfigureAsync only,
and the active-orders sample awaits the chart's save instead of the obsolete blocking wrapper. The
package-based projects of the same samples compile once a StockSharp.Xaml package that has ConfigureAsync is
published.
The Avalonia samples keep the connection settings through the awaited store: IConnectorSettingsStore reads
and writes through awaited members now, so the sample store reads or writes its file when it is asked instead
of reading both files up front and queueing its writes. The chart sample saves and loads its chart the same
way.
Eight Avalonia samples put the wheel date picker into columns of 150-170 pixels. It does not get narrower
than about three hundred, so the two of them ran over each other and over the Start and Stop buttons. They
take the compact calendar editor now, which the history testing sample already had.
Instrument lookups, configuration, credentials, CSV entities, snapshots and
the alert processing service are read and written asynchronously; the
blocking synchronous forms are obsolete wrappers.
IAsyncPersistable replaces IPersistable: every type that saves and loads its
settings has LoadAsync and SaveAsync only, and nested objects are read with
GetValueAsync, LoadEntireAsync and LoadAllAsync. The synchronous Load and Save
are the obsolete Ecng extensions. The MultiConnect sample keeps IPersistable
for two settings classes, because the settings window of the published
StockSharp.Xaml package takes it.
Copies that were made by saving and loading are made asynchronously.
IMessageAdapter, IIndicator, the risk, commission, PnL, latency, slippage and
position managers, IStorageBuffer, Strategy, DiagramElement, ICompositionModel
and its nodes get CloneAsync and no longer implement ICloneable; Clone is an
obsolete blocking wrapper. A strategy copy keeps every security and portfolio
parameter the original holds. Messages, FieldMapping, BankDetails and
WithdrawInfo are copied in memory. A CommissionRuleMessage shares its rule and
the emulator takes a copy of it. Envelope gets a constructor that takes all
three lines and CreateAsync.
ToBruteForce and ToBruteForceRandom become ToBruteForceAsync and
ToBruteForceRandomAsync and return IAsyncEnumerable; BruteForceOptimizer runs
over it and takes the next strategy through an asynchronous delegate.
Diagram elements keep their own state in SaveState, OnLoading and LoadState.
Undo restores an in-memory snapshot; a chart element holds its series and
axes in it by reference. An alert rule keeps its value in the form a message
carries it. A diagram strategy applies composition settings that were loaded
before the composition was set in SetCompositionAsync or at the start, and
saves them while they wait.
Strategies get an OnStartedAsync hook; diagram strategies resolve securities,
underlyings and strikes before the start so value processing never looks up
instruments. Paths.Serialize, SerializeInvariant, AppStartSettings.TrySave,
ICredentialsProvider.Save, ISnapshotSerializer.Serialize and the composition
registry gain async forms.
ICredentialsProvider.Delete becomes DeleteAsync, so loading, saving and
deleting the credentials wait for one another. Paths.InstalledVersion and
AppNameWithVersion are obsolete in favour of GetInstalledVersionAsync and
GetAppNameWithVersionAsync.
A file is opened for writing only after the last cancellation check, because
opening it empties it; a cancelled read reports the cancellation instead of
an empty result. A snapshot flush that failed leaves what it took due for the
next one.
The indicator templates for C#, F# and Python override LoadAsync and
SaveAsync.
Two of them call CancellationToken.None without importing System.Threading. The third names EventSubscription without importing StockSharp.Xaml, and inside a window that name then binds to the nested type a window inherits from Avalonia Interactive, which is not accessible; every other sample that uses it imports the namespace. None of the three built.
The Avalonia samples were written before the shared Avalonia stack existed and
had grown their own copies of what it already does: connector setup, event
routing to the UI thread, dispatcher plumbing. Each copy was a second answer to
a question the library had answered, and the two drifted. They use the library
now, and where a sample needed something the library did not expose - a
UI-thread event subscription, a connector-settings store - that piece moved into
the shared layer rather than staying a sample's private helper, so an
application gets it too.
They also lived in a tree of their own, SamplesAvalonia, mirroring the folder
names of Samples exactly. A reader who wanted to compare the two versions of one
example had to know that the trees mirrored each other and navigate both, and
nothing in either tree said the other existed. It is one tree now: each example's
Avalonia version sits in the same area folder as its WPF version, next to it.
The WPF samples keep the names and folders they have always had, so every link
and path that points at them still resolves. It is the Avalonia version that
says which head it is - 01_HistorySMA_Avalonia beside 01_HistorySMA, and
01_Strategies.HistorySMA_Avalonia beside 01_Strategies.HistorySMA, with the
source-built twins following as _Avalonia_fromsrc.
That suffix reaches the assembly name, which is what makes the two builds
distinguishable, but not the root namespace: the sources and their x:Class
declarations keep the namespace they have, so nothing inside the samples had to
change. The namespaces do follow the rename that separated assembly names from
namespaces, and the history samples ask for a UTC day instead of the machine's,
which is what the storage is keyed by - a sample run west of UTC asked for the
wrong day.
All 63 examples - 35 WPF and 28 Avalonia - are now in Samples.slnx and in
StockSharp.slnx, and in StockSharp_CI.slnx, which is the solution the Windows CI
job builds: the Avalonia samples were in no solution at all, so nothing ever
checked that they still compiled.
The tests that read the sample sources - counting files, matching strings in
markup, asserting a project reference exists - are gone. They restated the tree
rather than running anything in it, so they passed for samples that could not
start and failed for edits that changed nothing.
Strategy.Start/Stop are obsolete in favour of StartAsync/StopAsync. Where the
caller was already async it now awaits. Where it is a click handler or a
void-returning event delegate it cannot await, so the call follows the pattern
BaseOptimizer already uses for the same situation: launch the task and report
only its failure, rather than blocking the caller or turning it into async void.
SmaServerStopStrategy declared a private OnOrderChanged that hid the virtual hook
of the same name, then subscribed to OrderReceived by hand to reach it - so the
framework hook sat dead. It is an override now and the manual subscription is
gone. The Designer template copy had the same defect.
MarketQuotingStrategy is obsolete in favour of QuotingProcessor, which is not a
Strategy and so cannot be handed to the sample's strategy editor. The terminal
sample gets a small strategy of its own that drives the processor.
When starting the optimization SetIsEnabled was called with canSuspend=false, so
the Pause button stayed disabled for the whole run even though BaseOptimizer
supports Pause/Resume (the click handler was already wired). Pass canSuspend=true
so the button is active while the optimization is running.
The result panel was driven in the wrong order: AddStrategy was called only at
100% (end of each iteration) while UpdateProgress was called for 1..99%.
StrategiesStatisticsPanel both registers the strategy in its lookup map and
subscribes to the strategy PnL feed inside AddStrategy. Calling it last meant
UpdateProgress had no row to update (so Progress stayed 0) and the PnL
subscription was attached only after the backtest had already finished (so the
equity sparkline stayed empty).
Register the strategy on its first progress event (deduped by Strategy.Id) and
only update progress afterwards, matching how the Designer optimizer panel uses
the control. Now the Progress column climbs to 100% and the P&L chart is filled
while the run is in progress.