'How enable/disable window's close button the X-button in Mvvm

In my project I have a Task. When is running the X-button must be disable, and when the task is finish the X-button must be enabled, all this in view model.

I need something like this:

... Disable_X-button_window()

Task.Run(ImportAll);

... Enable_X-button_window()

Anyone have an example for this issue?

Regards



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source