diff --git a/CHANGELIST.md b/CHANGELIST.md
index 2aa91817..197a4812 100644
--- a/CHANGELIST.md
+++ b/CHANGELIST.md
@@ -10,6 +10,7 @@
- Support ancient .NET in UI
- Fix TLS for older .NET
- Perform more ancient .NET support work
+- Prepare XAML for ancient .NET support
### 3.0.0 (2023-11-14)
diff --git a/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml b/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml
index 85284c3f..67e4498d 100644
--- a/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml
+++ b/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml
@@ -9,10 +9,6 @@
Title="" MinHeight="155" MaxWidth="470" MinWidth="154"
BorderBrush="DarkGray" BorderThickness="2">
-
-
-
-
diff --git a/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml.cs b/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml.cs
index 7bab33ad..23ee89dd 100644
--- a/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml.cs
+++ b/MPF.UI.Core/External/WPFCustomMessageBox/CustomMessageBoxWindow.xaml.cs
@@ -88,6 +88,15 @@ namespace WPFCustomMessageBox
internal CustomMessageBoxWindow(Window? owner, string? message, string? caption = null, MessageBoxButton? button = null, MessageBoxImage? image = null, bool removeTitleBarIcon = true)
{
+#if NET452_OR_GREATER
+ var chrome = new System.Windows.Shell.WindowChrome
+ {
+ CaptionHeight = 0,
+ ResizeBorderThickness = new Thickness(0),
+ };
+ System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
+#endif
+
InitializeComponent();
_removeTitleBarIcon = removeTitleBarIcon;
diff --git a/MPF.UI.Core/Windows/DiscInformationWindow.xaml b/MPF.UI.Core/Windows/DiscInformationWindow.xaml
index 3d08e688..97b0491a 100644
--- a/MPF.UI.Core/Windows/DiscInformationWindow.xaml
+++ b/MPF.UI.Core/Windows/DiscInformationWindow.xaml
@@ -15,10 +15,7 @@
-
-
-
-
+
diff --git a/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs b/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs
index e896aa34..073d7c1f 100644
--- a/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs
@@ -22,6 +22,15 @@ namespace MPF.UI.Core.Windows
///
public DiscInformationWindow(Options options, SubmissionInfo? submissionInfo)
{
+#if NET452_OR_GREATER
+ var chrome = new System.Windows.Shell.WindowChrome
+ {
+ CaptionHeight = 0,
+ ResizeBorderThickness = new Thickness(0),
+ };
+ System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
+#endif
+
InitializeComponent();
DataContext = new DiscInformationViewModel(options, submissionInfo);
DiscInformationViewModel.Load();
@@ -341,7 +350,7 @@ namespace MPF.UI.Core.Windows
}
}
-#endregion
+ #endregion
#region Event Handlers
diff --git a/MPF.UI.Core/Windows/MainWindow.xaml b/MPF.UI.Core/Windows/MainWindow.xaml
index 40b1f056..fec5d680 100644
--- a/MPF.UI.Core/Windows/MainWindow.xaml
+++ b/MPF.UI.Core/Windows/MainWindow.xaml
@@ -18,9 +18,6 @@
-
-
-
diff --git a/MPF.UI.Core/Windows/MainWindow.xaml.cs b/MPF.UI.Core/Windows/MainWindow.xaml.cs
index df217d14..a531f680 100644
--- a/MPF.UI.Core/Windows/MainWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/MainWindow.xaml.cs
@@ -20,7 +20,19 @@ namespace MPF.UI.Core.Windows
///
/// Constructor
///
- public MainWindow() => InitializeComponent();
+ public MainWindow()
+ {
+#if NET452_OR_GREATER
+ var chrome = new System.Windows.Shell.WindowChrome
+ {
+ CaptionHeight = 0,
+ ResizeBorderThickness = new Thickness(0),
+ };
+ System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
+#endif
+
+ InitializeComponent();
+ }
///
/// Handler for MainWindow OnContentRendered event
diff --git a/MPF.UI.Core/Windows/OptionsWindow.xaml b/MPF.UI.Core/Windows/OptionsWindow.xaml
index 4bc96352..9758cd5c 100644
--- a/MPF.UI.Core/Windows/OptionsWindow.xaml
+++ b/MPF.UI.Core/Windows/OptionsWindow.xaml
@@ -13,9 +13,6 @@
-
-
-
diff --git a/MPF.UI.Core/Windows/OptionsWindow.xaml.cs b/MPF.UI.Core/Windows/OptionsWindow.xaml.cs
index 6602990f..7f8d39eb 100644
--- a/MPF.UI.Core/Windows/OptionsWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/OptionsWindow.xaml.cs
@@ -24,6 +24,15 @@ namespace MPF.UI.Core.Windows
///
public OptionsWindow(Options options)
{
+#if NET452_OR_GREATER
+ var chrome = new System.Windows.Shell.WindowChrome
+ {
+ CaptionHeight = 0,
+ ResizeBorderThickness = new Thickness(0),
+ };
+ System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
+#endif
+
InitializeComponent();
DataContext = new OptionsViewModel(options);
@@ -159,7 +168,7 @@ namespace MPF.UI.Core.Windows
CustomMessageBox.Show(this, message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
-#endregion
+ #endregion
#region Event Handlers
diff --git a/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml b/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml
index faf13007..7ac3bd47 100644
--- a/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml
+++ b/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml
@@ -10,10 +10,6 @@
WindowStartupLocation="CenterOwner" ResizeMode="CanMinimize" SizeToContent="Height"
BorderBrush="DarkGray" BorderThickness="2">
-
-
-
-
diff --git a/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs b/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs
index 1f3207a9..3cd072ed 100644
--- a/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs
@@ -5,6 +5,18 @@
///
public partial class RingCodeGuideWindow : WindowBase
{
- public RingCodeGuideWindow() => InitializeComponent();
+ public RingCodeGuideWindow()
+ {
+#if NET452_OR_GREATER
+ var chrome = new System.Windows.Shell.WindowChrome
+ {
+ CaptionHeight = 0,
+ ResizeBorderThickness = new System.Windows.Thickness(0),
+ };
+ System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
+#endif
+
+ InitializeComponent();
+ }
}
}