I want to perform onCloseCommand(object sender) method form onTimeOutCommand() method, but I don't know how to pass the required parameter passed from this method?
Plese refer the following code snippet.
XAML code:
x:name = "Recorder" // window name define in the begining
//below command is used for closing this window when user clicks on close button
Command = "{Binding CloseCommand}" CommandParameter="{Binding ElementName=Recorder}"
ViewModel Code:
CloseCommand = new DelegateCommand<object>(helper.onCloseCommand);
ViewModelHelper Code:
Note: onCloseCommand() methodis working as per expectation
onCloseCommand(object sender) // This method is used for closing the window on clicking on close button of this window
{
if(sender != null && send is window)
{
(sender as window).close();
}
}
onTimeOutCommand() // this method is used for closing the window (the window which is passed in onCloseCommand() method) automaticlly after time out of the recording
{
how to perform onCloseCommand() from this method?
}