WPF C# Cefsharp 版本。71,我有一个 URL 和一个 cookie,它将绕过登录并显示最终结果。但是,直到我返回加载到我的 cefsharp 组件中的响应页面时,xaml 仍然是空白的,我想显示“请稍候,正在加载...”标志。我该怎么做?我确实有一个代码可以显示相同的内容,但我猜它的放置不正确。下面是例子:
// Called on Loaded even of xaml
private async void OnLoad()
{
if (Loaded)
return;
try
{
IsBusy = true; // if true we show overlay progress bar user control
var api = OrganizerApi.GetInstance();
string key = await GetVtsToken();
if (!string.IsNullOrEmpty(key))
{
var cookieManager = Cef.GetGlobalCookieManager();
Cookie cookie = new Cookie
{
Name = api.SecurityDomain,
Value = key
};
cookieManager.SetCookie(api.OrganizerUrl, cookie);
Address = api.OrganizerUrl;
Loaded = true;
}
IsBusy = false;
}
catch (Exception e)
{
IsBusy = false;
_logger.Error(e.Message);
}
}
//覆盖进度条用户控件显示“请稍候,正在加载...”模式
<progress:OverlayBox OverlayOnElemement="{Binding ElementName=OrganizerGrid, Mode=OneWay}"
IsShown="{Binding Path=IsBusy}"
Message="{translation:Translation msg.loading.generic}"
Grid.Row="1" Grid.RowSpan="1" Grid.ColumnSpan="1"
/>