// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // Interaction logic for ShellView.xaml // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.Views { using System.Windows; using HandBrakeWPF.ViewModels.Interfaces; /// /// Interaction logic for ShellView.xaml /// public partial class ShellView : Window { /// /// Initializes a new instance of the class. /// public ShellView() { this.InitializeComponent(); } /// /// Check with the user before closing. /// /// /// The CancelEventArgs. /// protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { bool canClose = ((IShellViewModel)this.DataContext).CanClose(); if (!canClose) { e.Cancel = true; } base.OnClosing(e); } } }