Refactor instructions for infrastructure module

2 posts, 0 answers
  1. Adam
    Adam avatar
    4 posts
    Member since:
    Dec 2012

    Posted 26 Jan 2013 Link to this post

    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 ?)
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 30 Jan 2013 Link to this post

    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.

  3. DevCraft banner
Back to Top