示例#1
0
        private void CloseClick(object sender, RoutedEventArgs e)
        {
            var closingWindowEventHandlerArgs = new ClosingWindowEventHandlerArgs();
            OnClosingWindow(closingWindowEventHandlerArgs);

            if (closingWindowEventHandlerArgs.Cancelled)
            {
                return;
            }

            ParentWindow?.Close();
        }
示例#2
0
 protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
 {
     var handler = ClosingWindow;
     handler?.Invoke(this, args);
 }