Issue #262: function GetQuotes load data from MT instead of using cached quotes

This commit is contained in:
Viacheslav Demydiuk
2025-12-05 23:43:27 +02:00
parent 0c874773e5
commit 249b0f9fbb
8 changed files with 88 additions and 60 deletions
+16
View File
@@ -162,6 +162,7 @@ namespace MtApi5TestClient
public DelegateCommand UnlockTicksCommand { get; private set; }
public DelegateCommand GetSymbolsCommand { get; private set; }
public DelegateCommand RefreshQuotesCommand { get; private set; }
#endregion
#region Properties
@@ -492,6 +493,7 @@ namespace MtApi5TestClient
UnlockTicksCommand = new DelegateCommand(ExecuteUnlockTicks);
GetSymbolsCommand = new DelegateCommand(ExecuteGetSymbols);
RefreshQuotesCommand = new DelegateCommand(ExecuteRefreshQuotes);
}
private bool CanExecuteConnect(object o)
@@ -1756,6 +1758,20 @@ namespace MtApi5TestClient
Symbols = result;
});
}
private async void ExecuteRefreshQuotes(object o)
{
_quotesMap.Clear();
Quotes.Clear();
var quotes = await Execute(() => _mtApiClient.GetQuotes());
if (quotes != null)
{
foreach (var quote in quotes)
{
AddQuote(quote);
}
}
}
private static void RunOnUiThread(Action action)
{