public class LanguageClient : AsyncPackage, ILanguageClient
{
public async Task<Connection> ActivateAsync(CancellationToken token)
{
...
}
public async Task OnLoadedAsync()
{
Config page = (Config)GetDialogPage(typeof(Config));
_path = page.OptionPath;
if (_path != null && _path != "")
{
await StartAsync.InvokeAsync(this, EventArgs.Empty);
}
}
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
{
// When initialized asynchronously, the current thread may be a background thread at this point.
// Do any initialization that requires the UI thread after switching to the UI thread.
Config page = (Config)GetDialogPage(typeof(Config));
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
}
Current behavior
The Page "Config" does exist but impossible to get it from the OnLoadedAsync I always obtain the default values.
But if I go directly to the settings InitializeAsync is called with the settings. InitializeAsync is called only when we go in the settings ?
Installed products
Description
Cannot get the settings from the ILanguageClient
Steps to recreate
Current behavior
The Page "Config" does exist but impossible to get it from the
OnLoadedAsync
I always obtain the default values. But if I go directly to the settings InitializeAsync is called with the settings. InitializeAsync is called only when we go in the settings ?Expected behavior
Should get the settings.