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

removed Website Reload when switching Tabs #271

Merged
merged 1 commit into from
Mar 16, 2014
Merged

removed Website Reload when switching Tabs #271

merged 1 commit into from
Mar 16, 2014

Conversation

JanEggers
Copy link
Contributor

it was a bit more complicated as i thought.

i thought that i only have to remove the ContentControl because the ContentTemplate causes the lazy load but the TabControl uses ContentPresenter internally so this did not help.

I Removed the whole lazy create approach and pass an emty handle / adress to the offscreenbrowser. i had to tune the OnResize code a bit because on my first attempt i got empty tab2

you should carefully look at the changes you did to the example. it loads horribly slow on my machine and throws tonns of binding errors which it did not get without the changes u made.

@JanEggers
Copy link
Contributor Author

i thought again on the changes i did.

i really like that the browser is now true offscreen ( doesnt rely on the Control Handle ).

What i dont like is the cleanup code as now its happening too late from my point of view. if the view is used really often they use resources until the app shuts down. i would prefere if cleanup is done on unload because thats the way is the most flexible.

i would like to add a frameworkElement property which controls lifetime. ie by default the webview itself. and in the TabControl usecase you could bind that property to the tabcontrol so the cleanup code is run when the tabcontrol is unloaded.

what do you think about that ?

perlun added a commit that referenced this pull request Mar 16, 2014
perlun added a commit that referenced this pull request Mar 16, 2014
…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.
perlun added a commit that referenced this pull request Mar 16, 2014
perlun added a commit that referenced this pull request Mar 16, 2014
@perlun perlun merged commit ad755cc into cefsharp:CefSharp3 Mar 16, 2014
@perlun
Copy link
Member

perlun commented Mar 16, 2014

Thanks Jan! I made some cleanups of the code. Some details:

  1. Try to be careful with preserving the same coding style as is already present, so that it doesn't look messy. I.e. don't write foo ( bar ) when the rest of the code uses foo(bar). I know this might be hard if you write a lot of code using some other syntax every day, but please, try, since it makes life easier on the rest of us not having to clean up after you... 😄
  2. Regarding the question with Loaded/Unloaded - your idea with a separate dependency property for the FrameworkElement to which the behavior could be attached is reasonable. Then again, I wonder how that would work with e.g. adding a new TabItem to a TabControl dynamically. The event would not be triggered, since the TabControl was already loaded...

I tend to lean towards saying that the current semantics (i.e. the one that we have right now) is the best. What do you think? What is your main problem with it, the way you see it?

@JanEggers
Copy link
Contributor Author

The event would not be triggered, since the TabControl was already loaded...

that does not matter the initializing code can remain in the constructor i only want the cleanup to run OnUnloaded.

write foo ( bar ) when the rest of the code uses foo(bar) .

No Problemo i only use ctrl a ctrl kf alot so i just need to change the spaceing settings in vs. i would like to tune them until no changes are applied and commit the vs settings that way there are no discussions on the settings just load them and done. and please set your resharper to use solution configuration and commit that also.

i didnt get a private license of resharper yet. we use it in our company and as your changes show i should get one.

I tend to lean towards saying that the current semantics (i.e. the one that we have right now) is the best. What do you think? What is your main problem with it, the way you see it?

we have a floating widget framework in our app and one widget should contain a cef browser. if the widget is closed i want that all visual resources are gone. in the current solution the browser and the browser subprocess remains intact until the app is closed. and its even worse if the user opens the widget again a new widget instance and browser instance is created to if you toggle the widget 10 times there are 10 subprocesses running. if add the property as mentioned above i can set it to my widget usercontrol and the browser is closed if the widget gets closed.

@JanEggers JanEggers deleted the NoReloadingTabsChange branch March 16, 2014 21:51
@perlun
Copy link
Member

perlun commented Mar 16, 2014

that does not matter the initializing code can remain in the constructor i only want the cleanup to run OnUnloaded.

OK, I see. I guess that would work. Feel free to experiment in that direction if you time & energy.

write foo ( bar ) when the rest of the code uses foo(bar) .

No Problemo i only use ctrl a ctrl kf alot so i just need to change the spaceing settings in vs. i would like to tune them until no changes are applied and commit the vs settings that way there are no discussions on the settings just load them and done. and please set your resharper to use solution configuration and commit that also.

Good point. I exported them now. Can you try them and see if you can get Ctrl-K F working? (I definitely know how useful it is...)

Btw, we switched from using the CefSharp3 branch to just master so you should get that branch from now on. It is mentioned in #266.

i didnt get a private license of resharper yet. we use it in our company and as your changes show i should get one.

Actually, I think I can fix a free one for you if you like (since ReSharper/JetBrains has a program which is free for open source). I did apply for it earlier and was granted a license but I never used it since I use the same (MacBook Pro...) for both work and hobbies. So I think I could ask them to give you a license if you like. Email me your details (perlun at gmail i-eat-spammers-for-breakfast dot com) and I'll contact them about it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants