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!
Inside the VM:
Option 1:
this.SaveAndCloseViewModelAsync();
Option 2:
this.CancelAndCloseViewModelAsync();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.