WPF C# Cefsharp Ver。 71,我有一个 URL 和一个 cookie,它将绕过登录并显示最终结果,直到显示加载
WPF C# Cefsharp Ver. 71, i have a URL and a cookie which will bypass login and show end results, till then show loading
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"
/>
升级到最新版本,因为最新版本支持此类功能
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"
/>
升级到最新版本,因为最新版本支持此类功能