Strange behaivor with tabbed interface noticed on 2.4.1201162023-beta

Jan 18, 2012 at 5:44 PM
Edited Jan 18, 2012 at 6:43 PM

In recent times I'm introduce the beta version on my projects in order to use the Catel 2.5 forthcoming features.

I'm use with success these versions

Catel.Silverlight.2.4.20111221-beta.nupkg
Catel.Silverlight.2.4.1112231055-beta.nupkg
Catel.Silverlight.2.4.1112231932-beta.nupkg
Catel.Silverlight.2.4.1112291703-beta.nupkg
Catel.Silverlight.2.4.1112292305-beta.nupkg

Everything works until I introduce the 2.4.1201162023-beta

Catel.Silverlight.2.4.1201162023-beta.nupkg -->  I think the problem can be related with "BREAKING CHANGE: Removed IDisposable from IViewModel and IDataObjectBase, objects no longer need to be disposed", but I'm not sure.
Catel.Silverlight.2.4.1201171907-beta.nupkg  --> This change did not cause any problems, great feature :) "Added nested view models validation summaries to allow the retrieval of a validation summary from a view model tree"

The symptom is pretty rare: I have a model share between viewmodels (registered as singleton on a unity containers). I'm also have a tabbed interface that display, allow edit, the model data via viewmodels. Each tab contains a control or view that allow edit or display partial data corresponding with it's viewmodel from the single model. Everything works until I introduce the 2.4.1201162023-beta. Seems like an unloaded or close ViewModel. I'm set CloseViewModelOnUnloaded to False.

What change did you introduce on Catel.Silverlight.2.4.1201162023-beta or after Catel.Silverlight.2.4.1112292305-beta that can provoke this symptom?

Note: This thread is not related with this. There no abstract viewmodels classes.

Jan 18, 2012 at 7:04 PM

The ViewModelLifetime example (which is WPF) works ok with the latest build. We added this fix:

(x) Fixed issue where the Nested User Controls would construct a view model twice for the same model

Is it possible for you to send me a POC or the source?

Jan 18, 2012 at 7:35 PM
Edited Jan 18, 2012 at 9:05 PM

Now that you mention it, looks exactly like the 'Nested User Controls reconstructing the view model or late the  initialization'.

I will try to extract a POC from my application because the source code is too large.

Meanwhile I will narrate you the symptom with accuracy:  The shell or main control contains two tabs. The first tab has no nested controls and works fine. The second tab contains nested controls with three levels, and is not working properly. First activation of the second tab display blank combo-boxes, no error notifications tool tips. Second of the second tab activation display combo-boxes with data, and errors notification tool tips are displayed. Third, fourth, fifth, so on activations of the second tab display blank combo-boxes, no error notifications tool tips are displayed. Looks like a null view model 'instance' associated to the user control.

Jan 18, 2012 at 9:52 PM

I write an example from scratch and works.

On my application doesn't works yet.

Jan 19, 2012 at 3:19 PM

I install back the Catel.Silverlight.2.4.1112292305-beta and my application works .

When install the Catel.Silverlight.2.4.1201162023-beta or Catel.Silverlight.2.4.1201171907-beta, my application is not working properly with the symtom described above.

The main difference between the example and my application is the way the views are constructed.

The example the tabs content are written directly on XAML, on my application the tab content are injected dynamically using PRIMS approach.

I'm still looking for the problem.

Jan 19, 2012 at 3:25 PM

Thanks for the update. I know that prism also injects later, so it might has to do something with that. However, it did work before as you said. This was because previously, the view model was set twice (and now only once). Maybe prism needed the second one as well.

What you can do is download the source and undo the fix.

Jan 19, 2012 at 3:53 PM

Ok,  (remember very slowly and limited internet access issue)

%hg clone --config http_proxy.host= --verbose https://hg01.codeplex.com/catel -- D:\Workspaces\Catel4% is running, I'm waiting.

Jan 19, 2012 at 7:05 PM

Impossible

Log:
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: stream ended unexpectedly (got 3162885 bytes, expected 17108131)
[command returned code 255 Thu Jan 19 12:23:11 2012]

Jan 19, 2012 at 10:09 PM

crap, then I'' have to find another way. Tomorrow I shall create a custom build for you without the fix. I will send it to your mail.

Jan 20, 2012 at 9:18 AM

You've got mail

Jan 20, 2012 at 2:11 PM

Thanks,

I'm already tested. The simptom have a slightly difference.

Now:  The 1st activation of the 2nd tab (with nested controls) display data and error notifications. The next activations looks like the nested control miss the view model (no data, no error notifications). 

Before: Only the 2nd activation of the 2nd tab (with nested controls) works (1st, 3th, ..., n doesn't).

I repeat only on the nested control view model.

Note: The second tab also implements a master/detail situation using the catel approach.

Jan 20, 2012 at 4:51 PM

I send you the POC, plus a video, demostrating the behavior.

You've got mail.

Jan 20, 2012 at 4:55 PM

Thanks, will look into this tomorrow.

Jan 20, 2012 at 8:32 PM

So, what about this ;).

Have you any clue?

Jan 21, 2012 at 2:34 PM

I have been debugging this yesterday, haven't found the issue yet. Will continue searching today.

Jan 21, 2012 at 4:44 PM

I think I just nailed the MF :)