Hi,
I'm using a RadTabControl with a different usercontrol inside each tabs. Each user control has it's own viewModel. Now I'm trying to assign the datacontext of a usercontrol BEFORE the tab has been Loaded (the user did not visit this tab). Here is the code I'm using:
This works fine, except when the user navigates to the tabItem, it looks like my initialization is gone and a new usercontrol is created from scratch. Am I misunderstanding something in the RadTabControl behavior?
Is there a way maybe to PreLoad all tabItems? Or maybe there's a better way to handle this... Please help me out.
Thanks
Marc
I'm using a RadTabControl with a different usercontrol inside each tabs. Each user control has it's own viewModel. Now I'm trying to assign the datacontext of a usercontrol BEFORE the tab has been Loaded (the user did not visit this tab). Here is the code I'm using:
ucProjectLayoutV2 =
new
ProjectLayoutV2View();
ucProjectLayoutV2.DataContext =
new
VM.ProjectLayoutViewModel();
This works fine, except when the user navigates to the tabItem, it looks like my initialization is gone and a new usercontrol is created from scratch. Am I misunderstanding something in the RadTabControl behavior?
Is there a way maybe to PreLoad all tabItems? Or maybe there's a better way to handle this... Please help me out.
Thanks
Marc