Search code examples
c#wpfcefsharp

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 Ver. 71, i have a URL and a cookie which will bypass login and show end results. However, till the time i get back response page loaded in my cefsharp component, the xaml remains blank and i want to show "please wait, loading..." sign. How to i do it? I do have a code to show the same but i guess placing of that is not correct. Below is example:

// 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);
            }
        }

//Overlay progress bar user control show "please wait, loading..." modal

<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"
        />

Solution

  • Upgrade to latest version as latest version has support for this type of features