mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Get UI building with Framework 4.0 again
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
- Support .NET Framework 3.5 in UI.Core
|
||||
- Get UI building with Framework 4.0
|
||||
- Temporarily remove .NET Framework 4.0 from UI
|
||||
- Get UI building with Framework 4.0 again
|
||||
|
||||
### 3.0.0 (2023-11-14)
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace MPF.Core.Utilities
|
||||
|
||||
// Get the latest tag from GitHub
|
||||
var (tag, url) = GetRemoteVersionAndUrl();
|
||||
bool different = version != tag;
|
||||
bool different = version != tag && tag != null;
|
||||
|
||||
string message = $"Local version: {version}"
|
||||
+ $"{Environment.NewLine}Remote version: {tag}"
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace MPF.UI.Core.Windows
|
||||
(bool different, string message, var url) = MainViewModel.CheckForUpdates();
|
||||
|
||||
// If we have a new version, put it in the clipboard
|
||||
if (different)
|
||||
if (different && !string.IsNullOrEmpty(url))
|
||||
Clipboard.SetText(url);
|
||||
|
||||
if (showIfSame || different)
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true"/>
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
||||
<!--<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>--> <!-- Not supported in .NET Framework 3.5 or 4.0 -->
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</MultiTrigger>
|
||||
@@ -264,7 +264,7 @@
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true"/>
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
||||
<!--<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>--> <!-- Not supported in .NET Framework 3.5 or 4.0 -->
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</MultiTrigger>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Data;
|
||||
@@ -23,11 +22,6 @@ namespace MPF
|
||||
|
||||
AddDropShadowChrome("ComboBoxTemplate");
|
||||
AddDropShadowChrome("ComboBoxEditableTemplate");
|
||||
|
||||
#if FALSE && (NET452_OR_GREATER || NETCOREAPP)
|
||||
AddVirtualizingCondition("ComboBoxTemplate");
|
||||
AddVirtualizingCondition("ComboBoxEditableTemplate");
|
||||
#endif
|
||||
}
|
||||
|
||||
private void AddDropShadowChrome(string resourceName)
|
||||
@@ -189,40 +183,6 @@ namespace MPF
|
||||
triggers.Add(hasItems);
|
||||
triggers.Add(canContentScroll);
|
||||
}
|
||||
|
||||
#if NET452_OR_GREATER || NETCOREAPP
|
||||
private void AddVirtualizingCondition(string resourceName)
|
||||
{
|
||||
// Get the template resource
|
||||
if (Resources[resourceName] is not ControlTemplate controlTemplate)
|
||||
return;
|
||||
|
||||
// Get the triggers
|
||||
var triggers = controlTemplate.Triggers;
|
||||
if (triggers == null)
|
||||
return;
|
||||
|
||||
// Get the multitrigger
|
||||
if (triggers.FirstOrDefault(t => t is MultiTrigger) is not MultiTrigger multiTrigger)
|
||||
return;
|
||||
|
||||
// Set the virtualizing condition
|
||||
var isVirtualizing = new Condition
|
||||
{
|
||||
Property = VirtualizingPanel.IsVirtualizingWhenGroupingProperty,
|
||||
Value = "false",
|
||||
};
|
||||
|
||||
var currentConditions = multiTrigger.Conditions.ToList();
|
||||
multiTrigger.Conditions.Clear();
|
||||
foreach (var condition in currentConditions)
|
||||
{
|
||||
multiTrigger.Conditions.Add(condition);
|
||||
}
|
||||
multiTrigger.Conditions.Add(isVirtualizing);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Assembly Properties -->
|
||||
<TargetFrameworks>net452;net462;net472;net48;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net40;net452;net462;net472;net48;netcoreapp3.1;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<ApplicationIcon>Images\Icon.ico</ApplicationIcon>
|
||||
|
||||
Reference in New Issue
Block a user