6

Closed

Version 2 / Urgent / Performance / Tabbed Documents

description

Hi,
I found that the user controls associated to my viewmodels are re-created each time a document is activated...this is a known issue of the tab control in net 4 that you can solve
 
http://www.michaelalbaladejo.com/post/2010/10/26/WPF-TabControl-MVVM-et-gestion-des-instances-des-vues.aspx
 
Please, urgent for september, or this will block my release....thanks
Closed Dec 13, 2012 at 3:05 PM by adospace_cp (S-1-5-21-2518399693-1743467296-2023648240-3262238)
Fixed

comments

TheCamel wrote Aug 10, 2012 at 9:12 AM

you can test this with Home and Rss documents in my latest checkin on
http://wfpbookreader.codeplex.com/SourceControl/list/changesets

adospace wrote Aug 16, 2012 at 9:28 PM

hum, I'm not sure how I can solve the problem. Actually this is not an issue but a behavior common to the tabcontrol itself. For perfomance reasons tab control only shows the current content and unload it when user switch to another tab.
There are some workaround: I can suggest you to save the view control in a property of the ViewModel.

Ado

TheCamel wrote Aug 19, 2012 at 4:42 PM

the trouble in MVVM is that there is no link with the viewmodel. there is only view in my collection and the tab control creates them based on datatemplate...an option would be nice...i will look at that after my holidays. thanks

TheCamel wrote Sep 4, 2012 at 9:14 PM

Hi,
I download the last version, had a look to it and try your MVVM sample. If you open 2 files and make a word selection, you will see that this is lost when make tab selection changes...recognize that there is a problem with MVVM model and the "supposed" tab control implementation...

Can you please, tell me if you are going to implementing my proposal or not, because i don't see me to implement it on each release....-:(

I do not know your project as well a you do, but is there no way to add a property to the docking manager and use a different style in case of "KeepTabView" is set to true ??

Glad to hear from you

TheCamel wrote Sep 17, 2012 at 5:45 PM

I submit a patch 12885
not sure it is correctly linked to that
bye

adospace wrote Nov 14, 2012 at 10:31 AM

Hi,
with latest release (Build 2.0.1715) documents and anchorables views are cached automatically by AvalonDock. No setting is required to enable this behavior.
Please check out new version, thx
Ado

TheCamel wrote Nov 15, 2012 at 6:08 PM

man ! you've done it !
:-)
this build is integrated with custom design....very cool, you've got my five

ps : i would suggest that you create a doc page with all nice related project that use Avalondock. This will make a good reference for us, and perhaps you don't need to write the doc...you can use mine !