Prevent DataWindow Close from ViewModel

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

Hi Geert,

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

Thanks!

Coordinator
Aug 8, 2012 at 10:11 PM

Yes, handle the OnViewModelCanceling and return false.

Aug 10, 2012 at 12:14 PM

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!

Coordinator
Aug 10, 2012 at 12:15 PM

Thanks for the kind words :)

Aug 19, 2012 at 2: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'?

Coordinator
Aug 20, 2012 at 7: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.