Close ToolWindow Programmatically

4 posts, 0 answers
  1. James
    James avatar
    136 posts
    Member since:
    Nov 2008

    Posted 20 Jan 2010 Link to this post

    Hello,

    Is it possible to close a ToolWindow programmatically?

    I have a ToolWindow that hosts a View (MVVM) and I want the ToolWindow to close when a button is clicked.

    The View knows nothing about the ToolWindow (does not reference RadDocking assembly etc) so I can not implement a WindowCommands.Close command on the button to do this.

    So what I thought I could do is have my app's Shell Manager assembly (that does reference RadDocking) receive a "CloseView" event which passes in a reference to the View (UIElement). From there I can get a reference to the ToolWindow via ParentOfType<>. So far so good. But now there is no Close() on ToolWindow! I can see one but it's marked Internal ;-(

    Any suggestions on this?

    Regards,
    James

     

     

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 20 Jan 2010 Link to this post

    Hi James,

     You could use the same approach and trigger the WindowCommands.Close command from your view instead of searching for reference to the ToolWindow and calling its Close method (that is internal).

    Best wishes,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Yao
    Yao avatar
    8 posts
    Member since:
    May 2010

    Posted 30 Aug 2010 Link to this post

    hi, admin
        how to  trigger the WindowCommands.Close command from my view instead of searching for reference to the ToolWindow and calling its Close method.
        thanks!
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 02 Sep 2010 Link to this post

    Hi y y,

    What I would suggest you is to add a RadButton and set its Command property to be WindowCommands.Close.

    Hope this helps!

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top