cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.87k stars 2.92k forks source link

Browser Issue #417

Closed cpgtech closed 10 years ago

cpgtech commented 10 years ago

Hello I am a beginner in C # and I need your help to solve this .. I use cefsharp as Browser in my application. My Xaml, I have this

 <Grid x:Name="Browser"   Margin="10,15,514,10" HorizontalAlignment="Left" Width="400" Visibility="Collapsed"/>

To browse a web page in my webbrowser I use this code

private void browseThis(string url)
        {
            CefSharp.Settings settings = new CefSharp.Settings();
            settings.PackLoadingDisabled = true;
            if (CEF.Initialize(settings))
            {
                CefSharp.Wpf.WebView webView = new CefSharp.Wpf.WebView();
                Browser.Children.Add(webView);

                webView.Address = url;

            }
        }

It works a first time, then it does not work. example: if I open my application and If I type www.google.com. the browser displays the page of Google. if I enter a second URL www.yahoo.com. My browser is still on google page.

I have no error message.

Can you help me solve this little problem? I try to look here https://github.com/cefsharp/CefSharp/tree/CefSharp1/CefSharp.Wpf.Example but I still did not find solution.

Thanks

amaitland commented 10 years ago

@cpgtech I'd suggest you restructure your code quite a bit.

Hope this helps!

amaitland commented 10 years ago

Closing due to lack of feedback from OP.