after click on the button present in "MainWindow" ,i'm exporting some data into one file.
i want to close the MainWindow after completion of my exporting function....
how to do it....
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Yadagiri ReddyPosted Nov 4, 2014, 9:09 AM
below is my sample code
[XAML]
Title="ExportData" Height="600" Width="1000">
MessegeBox.Show("Exported Successfully");
// here i want the code for closing main window
Jaganathan BantheswaranPosted Nov 4, 2014, 7:43 AM
Then you have to use Command.
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
Content="Close Window" />
private void CloseCommandHandler(object sender, ExecutedRoutedEventArgs e)
{
this.Close();
}
Yadagiri ReddyPosted Nov 4, 2014, 7:00 AM
this.Close() doesn't work here.
tel me how to handle from viewmodel.
Jaganathan BantheswaranPosted Nov 4, 2014, 6:53 AM