This is a migrated thread and some comments may be shown as answers.

Refactor instructions for infrastructure module

1 Answer 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 26 Jan 2013, 02:19 PM
Hello, I have many places in my project where I load a view into RadTabControl (TabRegion) and I would like to refactor it to some kind of simple command or function. 
This is my code to refactor:
this.regionManager.RegisterViewWithRegion(RegionNames.TabRegion, () => container.Resolve<MyCustomView>());

I've tried to generate class in my Infrastructure module that would work like that:
OpenViewInNewTab(RegionNames.TabRegion, MyCustomView);

but I really don't know how to do this (especialy how to pass a type as a parameter). 

Maybe there is a better way to do this? (static method, DelegateCommand or maybe CompositeCommand ?)

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 30 Jan 2013, 05:15 PM
Hello Adam,

You can use a DelagateCommand with many RadControls like RadButton, RadMenuItem, RadTreeViewItem... However, I'm not sure if your question is related to the RadControls suite and their functionality as it seems to be mostly related to the PRISM structure you're implementing. This is why it might be better to post your question in the PRISM discussions portal instead.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Adam
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or