Prevent DataWindow Close from ViewModel

Topics: Questions
Aug 8, 2012 at 4:21 PM

Hi Geert,

is there a possibility to prevent from the viewmodel side the closing of the datawindow with the standard close button?


Aug 8, 2012 at 9:11 PM

Yes, handle the OnViewModelCanceling and return false.

Aug 10, 2012 at 11:14 AM

Hi Geert,

thanks a lot for the tip. It helped me a lot to eliminate a bug in my telerik DataWindow (RadWindow) adaption.

Btw: You (and your team) did a really good job with the DataWindow, it's a really cool and helpful class, because creating mvvm dialogs with it has never been easier... The complete framework is great!

Aug 10, 2012 at 11:15 AM

Thanks for the kind words :)

Aug 19, 2012 at 1:37 PM

I can't imagine how to implement that. OnViewModelCanceling is a method of the Catel.MVVM.Auditing Namespace. Do we have to handle it by that class, as it is described here? But OnViewModelCanceling is void, what do you mean with 'return false'?

Aug 20, 2012 at 6:52 AM

No, in the latest nuget betas, the view models also got a Canceling on the ViewModelBase as well. This is a new 3.3 feature.