Discussion of article "Continuous Walk-Forward Optimization (Part 7): Binding Auto Optimizer's logical part with graphics and controlling graphics from the program"

 

New article Continuous Walk-Forward Optimization (Part 7): Binding Auto Optimizer's logical part with graphics and controlling graphics from the program has been published:

This article describes the connection of the graphical part of the auto optimizer program with its logical part. It considers the optimization launch process, from a button click to task redirection to the optimization manager.

As already mentioned earlier, ViewModel is the connector between the graphical part of the application and the software implementation of the logic. It is the program graphics representation, which implements application logic calls and graphics reaction to the callbacks of the logical part of the application. Accordingly, a public property from the ViewModel part corresponds to each editable field in the graphical part of the application. These properties can either be getters, in which case they cannot be changed from the graphics, or setters, which allows overwriting the object hidden behind this property. In previous parts, we have already considered in detail the data binding technology. Therefore, I will only provide a few examples here. 

Text fields are connected using properties that have both write and read access. As an example, consider a field that indicates the name of an asset on which optimization will be performed. The XAML markup for this field is extremely simple.

    

<TextBox Width="100"          IsEnabled="{Binding EnableMainTogles, UpdateSourceTrigger=PropertyChanged}"          Text="{Binding AssetName}"/>

In addition to setting the width of the text window, it also has fields IsEnabled and Text. The first one sets whether the field is available for editing. If it is set to true, the field becomes available for editing. If it is false, then the field is locked. The "Text" field contains the text entered in this field. Then, there is a construction in curly braces opposite each of them. Its content sets the connection of the object with a certain public property from the ViewModel class specified after the "Binding" parameter.

Author: Andrey Azatskiy