diff --git a/CHANGELIST.md b/CHANGELIST.md
index 6aae6e28..554f85aa 100644
--- a/CHANGELIST.md
+++ b/CHANGELIST.md
@@ -35,6 +35,7 @@
- Support .NET Framework 2.0
- Support .NET Framework 3.5 in UI.Core
- Get UI building with Framework 4.0
+- Temporarily remove .NET Framework 4.0 from UI
### 3.0.0 (2023-11-14)
diff --git a/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs b/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs
index 60a0c16e..5ea28fdc 100644
--- a/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/DiscInformationWindow.xaml.cs
@@ -22,6 +22,8 @@ namespace MPF.UI.Core.Windows
///
public DiscInformationWindow(Options options, SubmissionInfo? submissionInfo)
{
+ InitializeComponent();
+
#if NET452_OR_GREATER || NETCOREAPP
var chrome = new System.Windows.Shell.WindowChrome
{
@@ -31,7 +33,6 @@ namespace MPF.UI.Core.Windows
System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
#endif
- InitializeComponent();
DataContext = new DiscInformationViewModel(options, submissionInfo);
DiscInformationViewModel.Load();
diff --git a/MPF.UI.Core/Windows/MainWindow.xaml.cs b/MPF.UI.Core/Windows/MainWindow.xaml.cs
index eadfdc37..08cccd80 100644
--- a/MPF.UI.Core/Windows/MainWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/MainWindow.xaml.cs
@@ -23,6 +23,8 @@ namespace MPF.UI.Core.Windows
///
public MainWindow()
{
+ InitializeComponent();
+
#if NET452_OR_GREATER || NETCOREAPP
var chrome = new System.Windows.Shell.WindowChrome
{
@@ -31,8 +33,6 @@ namespace MPF.UI.Core.Windows
};
System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
#endif
-
- InitializeComponent();
}
///
diff --git a/MPF.UI.Core/Windows/OptionsWindow.xaml.cs b/MPF.UI.Core/Windows/OptionsWindow.xaml.cs
index 01e30fef..64a5078f 100644
--- a/MPF.UI.Core/Windows/OptionsWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/OptionsWindow.xaml.cs
@@ -24,6 +24,8 @@ namespace MPF.UI.Core.Windows
///
public OptionsWindow(Options options)
{
+ InitializeComponent();
+
#if NET40_OR_GREATER || NETCOREAPP
DumpSpeedCDTextBox.IsReadOnlyCaretVisible = false;
DumpSpeedDVDTextBox.IsReadOnlyCaretVisible = false;
@@ -39,8 +41,6 @@ namespace MPF.UI.Core.Windows
};
System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
#endif
-
- InitializeComponent();
DataContext = new OptionsViewModel(options);
// Set initial value for binding
diff --git a/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs b/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs
index 508e0e43..ce839aae 100644
--- a/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs
+++ b/MPF.UI.Core/Windows/RingCodeGuideWindow.xaml.cs
@@ -7,6 +7,8 @@
{
public RingCodeGuideWindow()
{
+ InitializeComponent();
+
#if NET452_OR_GREATER || NETCOREAPP
var chrome = new System.Windows.Shell.WindowChrome
{
@@ -15,8 +17,6 @@
};
System.Windows.Shell.WindowChrome.SetWindowChrome(this, chrome);
#endif
-
- InitializeComponent();
}
}
}
diff --git a/MPF/App.xaml b/MPF/App.xaml
index 90e9f1f3..1eb131b4 100644
--- a/MPF/App.xaml
+++ b/MPF/App.xaml
@@ -219,6 +219,7 @@
+
@@ -263,6 +264,7 @@
+
diff --git a/MPF/App.xaml.cs b/MPF/App.xaml.cs
index 9ac6e197..7799d1aa 100644
--- a/MPF/App.xaml.cs
+++ b/MPF/App.xaml.cs
@@ -24,7 +24,7 @@ namespace MPF
AddDropShadowChrome("ComboBoxTemplate");
AddDropShadowChrome("ComboBoxEditableTemplate");
-#if NET452_OR_GREATER || NETCOREAPP
+#if FALSE && (NET452_OR_GREATER || NETCOREAPP)
AddVirtualizingCondition("ComboBoxTemplate");
AddVirtualizingCondition("ComboBoxEditableTemplate");
#endif
@@ -207,12 +207,19 @@ namespace MPF
return;
// Set the virtualizing condition
- var condition = new Condition
+ var isVirtualizing = new Condition
{
Property = VirtualizingPanel.IsVirtualizingWhenGroupingProperty,
Value = "false",
};
- multiTrigger.Conditions.Add(condition);
+
+ var currentConditions = multiTrigger.Conditions.ToList();
+ multiTrigger.Conditions.Clear();
+ foreach (var condition in currentConditions)
+ {
+ multiTrigger.Conditions.Add(condition);
+ }
+ multiTrigger.Conditions.Add(isVirtualizing);
}
#endif
diff --git a/MPF/MPF.csproj b/MPF/MPF.csproj
index d5006563..ebf9fe7b 100644
--- a/MPF/MPF.csproj
+++ b/MPF/MPF.csproj
@@ -2,7 +2,7 @@
- net40;net452;net462;net472;net48;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows
+ net452;net462;net472;net48;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows
win-x86;win-x64
WinExe
Images\Icon.ico