I am trying to remove a RadDocumentPane from a region when its closed, but I cant find a way to catch the close event in my viewmodel?
Whats the best approach to accomplished this with the Docking control?
Marcel
1 Answer, 1 is accepted
0
Accepted
Vladi
Telerik team
answered on 04 Aug 2015, 06:33 AM
Hello Marcel,
When a RadPane/RadDocumentPane instance is closed via its "Close" button the Close event of the RadDocking control is raised. In that event you can get the closed instances from the event args Pane collection. When working in a more MVVM scenarios you could use our EventToCommandBehavior in order to bring the Close event handler to the ViewModel. The next code snippet shows how the EventToCommandBehavior could be used in the RadDocking control.
the ViewModel's code should include something like this:
public class ViewModel
{
public ICommand CustomCommand { get; set; }
public ViewModel()
{
this.CustomCommand = new DelegateCommand(OnCustomCommandExecuted);
}
private void OnCustomCommandExecuted(object obj)
{
var args = obj as Telerik.Windows.Controls.Docking.StateChangeEventArgs;
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 Feedback Portal
and vote to affect the priority of the items