Example #1
0
        protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
        {
            var handler = ClosingWindow;

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

              if (closingWindowEventHandlerArgs.Cancelled) return;

              var parentWindow = GetParentWindow();
              if (parentWindow != null)
              {
            parentWindow.Close();
              }
        }
 // Clean up our event handlers when either of the children forms close.
 private void ChildWindowClosing(object sender, ClosingWindowEventHandlerArgs args)
 {
     if (sender == this.secondaryForm)
     {
         this.secondaryForm.Closing         -= this.ChildWindowClosing;
         this.secondaryForm.PropertyChanged -= this.LatestValueChanged;
     }
     else if (sender == this.thirdForm)
     {
         this.thirdForm.Closing         -= this.ChildWindowClosing;
         this.thirdForm.PropertyChanged -= this.LatestValueChanged;
     }
 }
Example #4
0
#pragma warning restore 618

        private void CloseClick(object sender, RoutedEventArgs e)
        {
            var closingWindowEventHandlerArgs = new ClosingWindowEventHandlerArgs();

            OnClosingWindow(closingWindowEventHandlerArgs);

            if (closingWindowEventHandlerArgs.Cancelled)
            {
                return;
            }

            if (null == this.ParentWindow)
            {
                return;
            }
            this.ParentWindow.Close();
        }
Example #5
0
        private void CloseClick(object sender, RoutedEventArgs e)
        {
            var closingWindowEventHandlerArgs = new ClosingWindowEventHandlerArgs();

            OnClosingWindow(closingWindowEventHandlerArgs);

            if (closingWindowEventHandlerArgs.Cancelled)
            {
                return;
            }

            var parentWindow = GetParentWindow();

            if (parentWindow != null)
            {
                parentWindow.Close();
            }
        }
Example #6
0
 protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
 {
     var handler = ClosingWindow;
       if (handler != null) handler(this, args);
 }