Skip to content

Instantly share code, notes, and snippets.

@dkalamari
Created June 5, 2013 08:24
Show Gist options
  • Select an option

  • Save dkalamari/5712421 to your computer and use it in GitHub Desktop.

Select an option

Save dkalamari/5712421 to your computer and use it in GitHub Desktop.
Anonymous methods for events using lambda
window.Closing += (sender, args) => {
if(Model.CanSave)
if (MessageBox.Show("Save?", "Saving", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
Model.Save();
}
else
{
Model.Cancel();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment