private void TemplatePartButtonMaximizeOnMouseUp(object sender, MouseButtonEventArgs args)
        {
            var windowActionArgs = new WindowButtonActionEventArgs(WindowAction.Maximize);

            OnWindowButtonAction(windowActionArgs);
            if (windowActionArgs.IsCanceled)
            {
                return;
            }

            WindowState = WindowState.Maximized;
        }
        private void TemplatePartButtonCloseOnMouseUp(object sender, MouseButtonEventArgs args)
        {
            var windowActionArgs = new WindowButtonActionEventArgs(WindowAction.Close);

            OnWindowButtonAction(windowActionArgs);
            if (windowActionArgs.IsCanceled)
            {
                return;
            }

            Close();
        }
        private void TemplatePartButtonRestoreOnMouseUp(object sender, MouseButtonEventArgs args)
        {
            var windowActionArgs = new WindowButtonActionEventArgs(WindowAction.Restore);
            OnWindowButtonAction(windowActionArgs);
            if (windowActionArgs.IsCanceled)
                return;

            WindowState = WindowState.Normal;
        }
        private void TemplatePartButtonMinimizeOnMouseUp(object sender, MouseButtonEventArgs args)
        {
            var windowActionArgs = new WindowButtonActionEventArgs(WindowAction.Minimize);
            OnWindowButtonAction(windowActionArgs);
            if (windowActionArgs.IsCanceled)
                return;

            WindowState = WindowState.Minimized;
        }
        private void TemplatePartButtonCloseOnMouseUp(object sender, MouseButtonEventArgs args)
        {
            var windowActionArgs = new WindowButtonActionEventArgs(WindowAction.Close);
            OnWindowButtonAction(windowActionArgs);
            if (windowActionArgs.IsCanceled)
                return;

            Close();
        }
 protected virtual void OnWindowButtonAction(WindowButtonActionEventArgs args)
 {
 }
 protected virtual void  OnWindowButtonAction(WindowButtonActionEventArgs args)
 {
 }