简体   繁体   中英

How to close Catel Framework Datawindow from the viewmodel

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM