0

private void InitProgressDialog(ProgressDialog progressDialog = null)
{
    _progressDialog = progressDialog;

    // check if the page parameter is available
    if (_progressDialog != null)
    {
        // build the loading page with native base
        _progressDialog.Parent = Application.Current.MainPage;

        _progressDialog.Layout(new Rectangle(0,
                                             0,
                                             Application.Current.MainPage.Width,
                                             Application.Current.MainPage.Height));

        _progressDialog.CancelButtonClicked += ProgressDialog_OnCancelButtonClicked;

        var renderer = Platform.GetRenderer(progressDialog);

        if (renderer == null)
        {
            renderer = Platform.CreateRenderer(_progressDialog);
            Platform.SetRenderer(_progressDialog, renderer);
        }

        var panel = new StackPanel();

        panel.Children.Add(renderer.ContainerElement);

        _dialog = new ContentDialog { Content = panel };

        _isInitialized = true;
    }
}

|