Esempio n. 1
0
 protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
 {
     WindowButtonCommands.ClosingWindowEventHandler closingWindowEventHandler = this.ClosingWindow;
     if (closingWindowEventHandler != null)
     {
         closingWindowEventHandler(this, args);
     }
 }
        protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
        {
            var handler = ClosingWindow;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Esempio n. 3
0
		private void WindowButtonCommands_ClosingWindows(object sender, ClosingWindowEventHandlerArgs e)
		{
			if (_isDoneClosing) return;
			e.Cancelled = true;
			if (!_isClosing)
			{
				_isClosing = true;
				StartClosingTasks();
			}
		}
        private void CloseClick(object sender, RoutedEventArgs e)
        {
            var closingWindowEventHandlerArgs = new ClosingWindowEventHandlerArgs();

            OnClosingWindow(closingWindowEventHandlerArgs);

            if (closingWindowEventHandlerArgs.Cancelled)
            {
                return;
            }

            this.ParentWindow.Close();
        }
        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();
            }
        }
Esempio n. 6
0
        private void CloseClick(object sender, RoutedEventArgs e)
        {
            ClosingWindowEventHandlerArgs closingWindowEventHandlerArg = new ClosingWindowEventHandlerArgs();

            this.OnClosingWindow(closingWindowEventHandlerArg);
            if (closingWindowEventHandlerArg.Cancelled)
            {
                return;
            }
            if (this.ParentWindow == null)
            {
                return;
            }
            this.ParentWindow.Close();
        }
        private void CloseWindow(object sender, ExecutedRoutedEventArgs e)
        {
            if (this.ParentWindow != null)
            {
                var args = new ClosingWindowEventHandlerArgs();
                this.ClosingWindow?.Invoke(this, args);

                if (args.Cancelled)
                {
                    return;
                }

                SystemCommands.CloseWindow(this.ParentWindow);
            }
        }
        private void CloseClick(object sender, RoutedEventArgs e)
        {
            var closingWindowEventHandlerArgs = new ClosingWindowEventHandlerArgs();

            OnClosingWindow(closingWindowEventHandlerArgs);

            if (closingWindowEventHandlerArgs.Cancelled)
            {
                return;
            }

            var parentWindow = this.TryFindParent <Window>();

            if (parentWindow != null)
            {
                parentWindow.Close();
            }
        }
        private void CloseClick(object sender, RoutedEventArgs e)
        {
            try
            {
                var closingWindowEventHandlerArgs = new ClosingWindowEventHandlerArgs();
                OnClosingWindow(closingWindowEventHandlerArgs);

                if (closingWindowEventHandlerArgs.Cancelled)
                {
                    return;
                }

                if (null == this.ParentWindow)
                {
                    return;
                }
                if (this.ParentWindow != null)
                {
                    this.ParentWindow.Close();
                }
            }
            catch { }
        }
Esempio n. 10
0
 protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
 {
     var handler = ClosingWindow;
     if (handler != null) 
         handler(this, args);
 }
Esempio n. 11
0
        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();
        }