From 3bbef170f42b7adb5819c8e7122fe0b7513ccbe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fele?= Date: Thu, 26 Oct 2023 22:45:07 +0200 Subject: [PATCH] Ensure the TextEnhancementView.xaml is always shown on top --- .../Views/TextEnhancement/TextEnhancementView.xaml.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs index eac9867..ae9bb1f 100644 --- a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs +++ b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs @@ -22,6 +22,12 @@ private void TextEnhancementView_OnLoaded(object sender, RoutedEventArgs e) // Place the window a bit moved to the top, so it is perfectly centered if we reach this.MaxHeight window.Top = Math.Max((currentScreenHeight - this.MaxHeight) / 2, 0); })); + + // Ensure window is shown above all other windows + window.Activate(); + window.Topmost = true; + window.Topmost = false; + window.Focus(); } private void TextEnhancementView_OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)