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

Close ToolWindow Programmatically

3 Answers 60 Views
Docking
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 20 Jan 2010, 09:40 AM

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

 

 

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 20 Jan 2010, 11:07 AM
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.
0
Yao
Top achievements
Rank 1
answered on 30 Aug 2010, 09:18 AM
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!
0
Miroslav Nedyalkov
Telerik team
answered on 02 Sep 2010, 07:24 AM
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
Tags
Docking
Asked by
James
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Yao
Top achievements
Rank 1
Share this question
or