-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Rendering multiple WebView controls within a single WPF app in 64 bit mode #212
Comments
Hi, Is this using CefSharp version 3? (the CefSharp3 branch) |
Yes it is using CefSharp3 branch |
OK. Will take a look at it sometime. |
I think I'm running into this as well. The intended behavior is like a tabbed browser, however only the first webview gets rendered, other ones are not. |
I tested this on commit e973bdb on CefSharp3 branch. Here are reproduction steps:
<Window x:Class="CefSharp.Wpf.Example.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
xmlns:example="clr-namespace:CefSharp.Example;assembly=CefSharp.Example"
Title="CefSharp.Wpf.Example"
WindowState="Maximized">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<ContentControl Grid.Row="0" x:Name="Content" />
<ContentControl Grid.Row="1" x:Name="Content2" />
</Grid>
</Window>
using System.Windows;
using CefSharp.Wpf.Example.Views.Main;
namespace CefSharp.Wpf.Example
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
var mainView = new MainView
{
DataContext = new MainViewModel()
};
Content.Content = mainView;
var mainView2 = new MainView
{
DataContext = new MainViewModel()
};
Content2.Content = mainView2;
}
}
}
|
+1 Can really do great stuff if this is resolved! |
Any updates? Thanks! |
If anybody is interested in contracting with Poll Everywhere (the company @steel and I are working for) to close this issue (and a few others) please email me brad at poll everywhere dot com. |
@bradgessler You've got mail. 😄 (In general, I think it would be incredibly nice if we could get more people involved in the project also, doing actual coding.) |
Hi, if fixed that issue in a local working copy. Im quite new to the open source process. can i commit that changes or is there some kind of review process ? the main issue was that webview cleans up code in unloaded Event but does not rebuild in loaded Event and does not set isOffscreenBrowserCreated to false when cleaning up and does not check it while accessing the browserwrapper .... |
@JanEggers the way you can do it is:
More details at https://help.github.com/articles/fork-a-repo |
thx for the info jornh. i tested a bit more and run into Problems again. if i use a tabview each tab containing a browser it works fine. if i place them in a grid only one works and for the others i see exceptions in Event log. System.ServiceModel.AddressAlreadyInUseException the javascriptproxy adress is not unique if i remove the creation of that host it works fine. ill create a fork on monday and commit my changes. have a nice weekend |
@dinoc, @damiga, @steel & @bradgessler: |
@JanEggers, I've now (finally!) reviewed the #258 change you did to fix this issue. It's mostly good, but I don't think the Take a look at the code I just pushed (to the CefSharp3 branch). It changes the WPF example a bit, so that we instead of having multiple browsers in one tab have one browser per tab (i.e. like any normal web browser these days). There are a couple of problems now:
Do you have any ideas of how we can solve that? |
yep that is no problemo we just need to use WebViews directly without any ContentControls i will do that in another pr |
…de so that one method makes assumptions about the exact method calls by other methods (which the comment previously did). That makes things too intertwined in my eyes.
Great news and work guys! Is there any place to get the binaries from, or I have to build it from source? |
@badbadboy, I'd say that it works quite well, from what I could tell (but there are some final tweaks I want to do before closing the issue completely). Please give it a try yourself. For now, no binaries are available (will hopefully be fixed quite soon) but you can build yourself using VS2010 or VS2012. VS2013 will be supported once #250 and #237 are done. |
@badbadboy with #288 merged into the Note: #288 gave us a dependency on that you must have NuGet on your machine and do a NuGet update to fetch the native |
Hey this got fixed 2 months ago: #212 (reference) but was never closed it seems. Let's do that! |
I'm using the latest Nuget release ( <ItemsControl>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Address}" />
<cefSharp:WebView Address="{Binding Address}" Width="100" Height="100" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl> Are the Nuget binaries up to date with the source that fixed it? |
@TheCloudlessSky Can you elaborate past it's |
@amaitland Broken means that it's the exact behavior described by @dinoc. Like I said, the source that fixed this issue is in I can definitely confirm that it's working if I build from |
@TheCloudlessSky I can see your frustrated, I do think it's important to remember this is an open source project, with a relatively small number of active contributors. Perhaps you'd like to take a second go at your previous comment? |
I know this is an old thread, but I've stumbled across it two or three times whilst researching similar issues so I thought I would contribute. First I just have to say well done to the developers of this project. You've massively improved my quality of life at my desk on my current project. Thank you! The previous comment about the issue with the tabs needing to be "clicked" in order to load is correct; this is not an issue with CefSharp at all, it's entirely to do with the way the TabView is designed. This is apparently not a bug but by design (as someone else has already said). I found an excellent approach to pre-loading tabs here: http://xcalibursystems.com/2012/07/make-your-tabcontrol-preload-in-wpf-silverlight/ It looks like it's for an older framework so a little adjustment is required. In particular, items.Last() doesn't seem to exist anymore so... // Update if not the last tab can be changed to and it works. The other issue that I encountered which was mentioned here is the inability to load more than one browser control in the same view. I played with this for a bit and managed to achieve it by placing one of the controls in a GroupBox like so. I've sliced and diced this out of a very large View so please forgive me if the tags don't all align but this is the general idea. A DockPanel as the main content and a grid inside the dockpanel docked somewhere (bottom in my case) with a nested groupbox that contains the second instance of the webbrowser. I wanted to embed the VMWare Scripted JavaScript editor in each tab of the browser so that's how I did it. I tried to add the Xaml to this message but the editor isn't having it.. if anyone wants sample code just email me. [email protected]. I'm using the most recent sources from GitHub as of two days ago. This thing works incredibly well and incredibly fast. |
@WolfieWerewolf How about posting as a |
Sure.. I'll extract the relevant bits from my VM and put one together in the morning. |
That was easier than I thought. I just modified the existing sample to make it easy for everyone. https://gist.github.com/WolfieWerewolf/2f3453d25942a0ceb8ef Enjoy! |
Cool, thanks 👍 |
No problem... something else that's cool is this thing I found on codeproject. http://www.codeproject.com/Articles/34377/DockPanel-Splitter-Control-for-WPF Since I had to put these in a DockPanel I couldn't use the grid splitter. This thing works very well. Just stick in in between the Closing Grid tag under the status bar and above the main ChromiumWebBrowser. /W |
If you setup a WPF app running against the 64 bit build of CefSharp, and you have 2 or more WebView controls in the main window, only 1 of the WebView controls will render output.
The text was updated successfully, but these errors were encountered: