private void Button_Click(object sender, RoutedEventArgs e) { ((sender as Button).DataContext as SaveOnQuitVM).Save = true; this.Close(); }