mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-09 08:57:52 +00:00
Updated test application (MT5) to perform testing function ChartId and ChartRedraw
This commit is contained in:
@@ -498,6 +498,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5">
|
||||
@@ -511,9 +512,16 @@
|
||||
<Button Command="{Binding ChartXYToTimePriceCommand}" Content="ChartXYToTimePrice" Margin="2"/>
|
||||
</WrapPanel>
|
||||
|
||||
<WrapPanel Grid.Row="2" VerticalAlignment="Top" Margin="5">
|
||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="5">
|
||||
<TextBlock Text="ChartID" VerticalAlignment="Center" Margin="2"/>
|
||||
<TextBox Width="150" Text="{Binding ChartFunctionsChartIdValue}" Margin="2"/>
|
||||
</StackPanel>
|
||||
|
||||
<WrapPanel Grid.Row="3" VerticalAlignment="Top" Margin="5">
|
||||
<Button Command="{Binding ChartApplyTemplateCommand}" Content="ChartApplyTemplate" Margin="2"/>
|
||||
<Button Command="{Binding ChartSaveTemplateCommand}" Content="ChartSaveTemplate" Margin="2"/>
|
||||
<Button Command="{Binding ChartIdCommand}" Content="ChartId" Margin="2"/>
|
||||
<Button Command="{Binding ChartRedrawCommand}" Content="ChartRedraw" Margin="2"/>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -81,6 +81,8 @@ namespace MtApi5TestClient
|
||||
public DelegateCommand ChartXYToTimePriceCommand { get; private set; }
|
||||
public DelegateCommand ChartApplyTemplateCommand { get; private set; }
|
||||
public DelegateCommand ChartSaveTemplateCommand { get; private set; }
|
||||
public DelegateCommand ChartIdCommand { get; private set; }
|
||||
public DelegateCommand ChartRedrawCommand { get; private set; }
|
||||
|
||||
public DelegateCommand TimeTradeServerCommand { get; private set; }
|
||||
public DelegateCommand TimeLocalCommand { get; private set; }
|
||||
@@ -195,6 +197,17 @@ namespace MtApi5TestClient
|
||||
OnPropertyChanged("ChartFunctionsSymbolValue");
|
||||
}
|
||||
}
|
||||
|
||||
private long _chartFunctionsChartIdValue;
|
||||
public long ChartFunctionsChartIdValue
|
||||
{
|
||||
get { return _chartFunctionsChartIdValue; }
|
||||
set
|
||||
{
|
||||
_chartFunctionsChartIdValue = value;
|
||||
OnPropertyChanged("ChartFunctionsChartIdValue");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
@@ -304,7 +317,8 @@ namespace MtApi5TestClient
|
||||
ChartXYToTimePriceCommand = new DelegateCommand(ExecuteChartXYToTimePrice);
|
||||
ChartApplyTemplateCommand = new DelegateCommand(ExecuteChartApplyTemplate);
|
||||
ChartSaveTemplateCommand = new DelegateCommand(ExecuteChartSaveTemplate);
|
||||
|
||||
ChartIdCommand = new DelegateCommand(ExecuteChartId);
|
||||
ChartRedrawCommand = new DelegateCommand(ExecuteChartRedraw);
|
||||
|
||||
TimeCurrentCommand = new DelegateCommand(ExecuteTimeCurrent);
|
||||
TimeTradeServerCommand = new DelegateCommand(ExecuteTimeTradeServer);
|
||||
@@ -1190,6 +1204,23 @@ namespace MtApi5TestClient
|
||||
|
||||
AddLog($"ChartOpen: success chartid=>{result}");
|
||||
}
|
||||
|
||||
private async void ExecuteChartId(object o)
|
||||
{
|
||||
var result = await Execute(() => _mtApiClient.ChartId());
|
||||
RunOnUiThread(() =>
|
||||
{
|
||||
ChartFunctionsChartIdValue = result;
|
||||
});
|
||||
AddLog($"ChartId: chartid = {result}");
|
||||
}
|
||||
|
||||
private void ExecuteChartRedraw(object o)
|
||||
{
|
||||
var chartId = ChartFunctionsChartIdValue;
|
||||
_mtApiClient.ChartRedraw(chartId);
|
||||
AddLog($"ChartRedraw: executed for chartid = {chartId}");
|
||||
}
|
||||
#endregion
|
||||
|
||||
private static void RunOnUiThread(Action action)
|
||||
|
||||
Reference in New Issue
Block a user