Reputation: 83
Does anyone know how to close (or save) the data window from your viewmodel and not use the ok or cancel button but custom buttons like this:
public class UploadWindow : DataWindow
{
public UploadWindow()
: base(DataWindowMode.Custom)
{
AddCustomButton(new DataWindowButton("Ok", "???"));
AddCustomButton(new DataWindowButton("Cancel", "???"));
InitializeComponent();
}
}
So i can do something extra before closing or saving other than the normal stuff. Thanks for the help!
Upvotes: 1
Views: 464
Reputation: 5724
Inside the VM:
Option 1:
this.SaveAndCloseViewModelAsync();
Option 2:
this.CancelAndCloseViewModelAsync();
Upvotes: 2