Files
mmd-pdf/Controls/WindowFx.cs
kua-agent 6610acfa44 feat: rebrand to MMD PDF, single corporate theme, and remove original text under an edit
- Services/PdfRedactText.cs: strip text whose origin falls inside a CoverAnnotation
  from the page content stream at save time, hooked into PdfBurn.DrawAnnotationsIntoDoc.
  Fixes edited values staying recoverable by text extraction.
- Themes/MMD.xaml replaces all thirteen themes; picker and accent strip removed; no dark mode.
- Rename KillerPDF -> MMD PDF across code, resources, packaging and locale strings; new icon.
- Remove the upstream author credit and the in-app install button.
2026-08-27 07:37:09 +02:00

34 lines
1.2 KiB
C#

using System;
using System.Windows;
using System.Windows.Media.Animation;
namespace MmdPdf
{
// Fade a window out on close: cancel the first close, animate opacity to 0, then close for real.
// DialogResult is set before Closing fires, so it survives the deferral.
internal static class WindowFx
{
public const int FadeMs = 150;
public static void EnableFadeClose(Window w, int ms = FadeMs)
{
bool fading = false;
bool readyToClose = false;
w.Closing += (s, e) =>
{
if (readyToClose) return; // our own post-fade Close - let it through
e.Cancel = true; // hold off the real close until the fade finishes
if (fading) return; // already fading - ignore repeat triggers
fading = true;
var anim = new DoubleAnimation(w.Opacity, 0, new Duration(TimeSpan.FromMilliseconds(ms)))
{
EasingFunction = new QuadraticEase { EasingMode = EasingMode.EaseOut }
};
anim.Completed += (_, _) => { readyToClose = true; w.Close(); };
w.BeginAnimation(UIElement.OpacityProperty, anim);
};
}
}
}