Add confirm before closing radwindow.

you can use previewclosed and set WindowPreviewClosedEventArgs's  property of cancel true  to implement to add confirm before closing radwindow.

void _win_PreviewClosed(object sender,Telerik.Windows.Controls.WindowPreviewClosedEventArgs e)
{
e.Cancel = true;
if (_viewModel.IsEnabledForButtonSave)
{
string confirmText = "Are you sure you want to close without saving?";
RadWindow.Confirm(confirmText, new EventHandler<WindowClosedEventArgs>(OnConfirmWindowClosed));
}
else
{
_proxy.Close();
_mProxy.Close();
_viewModel.BtnCloseClick();
e.Cancel = false;
}
}

 

posted @ 2012-02-20 12:06  左手边的爱  阅读(311)  评论(0编辑  收藏  举报