Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DownloadHander - Hide current browser #1431

Closed
epyweb opened this issue Nov 19, 2015 · 3 comments
Closed

DownloadHander - Hide current browser #1431

epyweb opened this issue Nov 19, 2015 · 3 comments

Comments

@epyweb
Copy link

epyweb commented Nov 19, 2015

Hi,

How can I hide the current browser when a "Save as" dialog appears ?

My Code:

private class DownloadHandler : IDownloadHandler
{

  public void OnBeforeDownload(IBrowser browser, DownloadItem downloadItem, IBeforeDownloadCallback callback)
  {

    if (!callback.IsDisposed)
    {
      using (callback)
      {
        callback.Continue(downloadItem.SuggestedFileName, showDialog: true);


      }
    }
  }

  public void OnDownloadUpdated(IBrowser browser, DownloadItem downloadItem, IDownloadItemCallback callback)
  {
    if (downloadItem.IsComplete || downloadItem.IsCancelled)
    {
      browser.GetHost().CloseBrowser(true);
    }
  }
}
@amaitland
Copy link
Member

There is nothing directly in CefSharp, it is only a browser control remember. You would need to pass a reference to your Form or Window.

@amaitland
Copy link
Member

@epyweb Any follow up on this one?

@amaitland
Copy link
Member

Closing due to lack of feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants