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

            if (handler != null)
            {
                handler(this, args);
            }
        }
Ejemplo n.º 3
0
		private void WindowButtonCommands_ClosingWindows(object sender, ClosingWindowEventHandlerArgs e)
		{
			if (_isDoneClosing) return;
			e.Cancelled = true;
			if (!_isClosing)
			{
				_isClosing = true;
				StartClosingTasks();
			}
		}
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo 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();
        }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
        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 { }
        }
Ejemplo n.º 10
0
 protected void OnClosingWindow(ClosingWindowEventHandlerArgs args)
 {
     var handler = ClosingWindow;
     if (handler != null) 
         handler(this, args);
 }
Ejemplo 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();
        }