protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
        {
            var handler = this.ClosingWindow;

            if (handler != null)
            {
                handler(this, args);
            }
        }
        private void CloseClick(object sender, RoutedEventArgs e)
        {
            var closingWindowEventHandlerArgs = new ClosingWindowEventHandlerArgs();

            this.OnClosingWindow(closingWindowEventHandlerArgs);

            if (closingWindowEventHandlerArgs.Cancelled)
            {
                return;
            }

            this.ParentWindow.Close();
        }