public static void MyOwnWindowClosing(object sender, CancelEventArgs e)
        {
            ICanCloseCheck  q = GetCanCloseCheck((Window)sender);
            ICanCloseResult p = GetCanCloseCheckParameter((Window)sender);

            if (q == null || p == null)
            {
                return;
            }


            q.CheckCanClose(p);
            e.Cancel = p.Cancel;
        }
 public void CheckCanClose(ICanCloseResult result)
 {
     CheckCanCloseAction?.Invoke(result);
 }
 public static void SetCanCloseCheckParameter(DependencyObject sender, ICanCloseResult value) => sender.SetValue(CanCloseCheckParameterProperty, value);