Skip to content

Commit 303f0ae

Browse files
authored
Merge pull request #1051 from lepoco/development
Merge development and bump version
2 parents bf3c4a6 + e5a24f1 commit 303f0ae

File tree

300 files changed

+3418
-3790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+3418
-3790
lines changed

.editorconfig

+23-7
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ file_header_template = This Source Code Form is subject to the terms of the MIT
5050
#### .NET Coding Conventions ####
5151

5252
# this. and Me. preferences
53-
dotnet_style_qualification_for_event = false:warning
54-
dotnet_style_qualification_for_field = false:warning
55-
dotnet_style_qualification_for_method = false:warning
56-
dotnet_style_qualification_for_property = false:warning
53+
dotnet_style_qualification_for_event = false:silent
54+
dotnet_style_qualification_for_field = false:silent
55+
dotnet_style_qualification_for_method = false:silent
56+
dotnet_style_qualification_for_property = false:silent
5757

5858
# Language keywords vs BCL types preferences
5959
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
@@ -95,8 +95,8 @@ dotnet_style_readonly_field = true:warning
9595

9696
# var preferences
9797
csharp_style_var_elsewhere = false:warning
98-
csharp_style_var_for_built_in_types = false:warning
99-
csharp_style_var_when_type_is_apparent = false:warning
98+
csharp_style_var_for_built_in_types = false:none
99+
csharp_style_var_when_type_is_apparent = false:none
100100

101101
# Expression-bodied members
102102
csharp_style_expression_bodied_accessors = false:silent
@@ -388,7 +388,7 @@ dotnet_diagnostic.SA1633.severity = none
388388
dotnet_diagnostic.SA1634.severity = none
389389
dotnet_diagnostic.SA1652.severity = none
390390

391-
dotnet_diagnostic.IDE0009.severity = none
391+
392392

393393
# Additional Stylecop Analyzers
394394
dotnet_diagnostic.SA1111.severity = none
@@ -397,3 +397,19 @@ dotnet_diagnostic.SA1204.severity = none
397397
dotnet_diagnostic.SA1208.severity = none
398398
dotnet_diagnostic.SA1518.severity = none
399399
dotnet_diagnostic.SA1615.severity = none
400+
dotnet_diagnostic.SA1502.severity = none
401+
dotnet_diagnostic.SA1010.severity = none # Opening square brackets should not be preceded by a space
402+
# conflicts with collection expressions and IDE0028
403+
404+
# Suppress some ValueConverter warnings
405+
dotnet_diagnostic.WPF0073.severity = none # Add ValueConversion attribute (unknown types)
406+
dotnet_diagnostic.WPF0071.severity = none # Add ValueConversion attribute
407+
dotnet_diagnostic.WPF0070.severity = none # Add default field to converter
408+
409+
# Suppress some IDE warnings
410+
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
411+
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
412+
# 15000+ warnings in the solution
413+
dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException throw helper
414+
# doesn't work with older versions of .NET
415+

.github/labeler.yml

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ themes:
3636
- changed-files:
3737
- any-glob-to-any-file: 'src/Wpf.Ui/Appearance/**'
3838

39+
titlebar:
40+
- changed-files:
41+
- any-glob-to-any-file: 'src/Wpf.Ui/Controls/TitleBar/**'
42+
3943
tray:
4044
- changed-files:
4145
- any-glob-to-any-file: 'src/Wpf.Ui.Tray/**'

.github/workflows/wpf-ui-cd-docs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v4
3030
- name: Setup Pages
31-
uses: actions/configure-pages@v4
31+
uses: actions/configure-pages@v5
3232
- name: Use Node.js 18.x
3333
uses: actions/setup-node@v4
3434
with:

.github/workflows/wpf-ui-cd-extension.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: windows-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: microsoft/setup-msbuild@v1.3
14+
- uses: microsoft/setup-msbuild@v2
1515
with:
1616
msbuild-architecture: x64
1717
- uses: nuget/setup-nuget@v2

.github/workflows/wpf-ui-cd-nuget.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: windows-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: microsoft/setup-msbuild@v1.3
14+
- uses: microsoft/setup-msbuild@v2
1515
with:
1616
msbuild-architecture: x64
1717
- uses: nuget/setup-nuget@v2
@@ -26,10 +26,10 @@ jobs:
2626
run: dotnet restore
2727

2828
- name: Build
29-
run: dotnet build src\Wpf.Ui\Wpf.Ui.csproj --configuration Release --no-restore
29+
run: dotnet build src\Wpf.Ui\Wpf.Ui.csproj --configuration Release --no-restore -p:SourceLinkEnabled=true
3030

3131
- name: Build
32-
run: dotnet build src\Wpf.Ui.Tray\Wpf.Ui.Tray.csproj --configuration Release --no-restore
32+
run: dotnet build src\Wpf.Ui.Tray\Wpf.Ui.Tray.csproj --configuration Release --no-restore -p:SourceLinkEnabled=true
3333

3434
- name: Publish the package to NuGet.org
3535
run: nuget push **\*.nupkg -NonInteractive -SkipDuplicate -Source 'https://api.nuget.org/v3/index.json'

.github/workflows/wpf-ui-pr-validator.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: windows-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: microsoft/setup-msbuild@v1.3
16+
- uses: microsoft/setup-msbuild@v2
1717
with:
1818
msbuild-architecture: x64
1919
- uses: nuget/setup-nuget@v2

Directory.Build.props

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<Project>
32
<PropertyGroup>
4-
<Version>3.0.3</Version>
3+
<Version>3.0.4</Version>
54
<LangVersion>12.0</LangVersion>
65
<Deterministic>true</Deterministic>
76
</PropertyGroup>
87

9-
<PropertyGroup>
10-
<Authors>lepo.co</Authors>
11-
<Company>lepo.co</Company>
12-
<Copyright>Copyright (C) 2021-2024 Leszek Pomianowski and WPF UI Contributors</Copyright>
13-
</PropertyGroup>
14-
158
<PropertyGroup>
169
<PackagesCommonFrameworks>net8.0-windows;net7.0-windows;net6.0-windows;net481;net472;net462</PackagesCommonFrameworks>
1710
</PropertyGroup>
1811

1912
<PropertyGroup>
13+
<Nullable>enable</Nullable>
14+
<ImplicitUsings>enable</ImplicitUsings>
2015
<PackageVersion>$(Version)</PackageVersion>
16+
<Authors>lepo.co</Authors>
17+
<Company>lepo.co</Company>
18+
<Copyright>Copyright (C) 2021-2024 Leszek Pomianowski and WPF UI Contributors</Copyright>
2119
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
2220
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2321
<PackageLicense>https://raw.githubusercontent.com/lepoco/wpfui/main/LICENSE</PackageLicense>
2422
<PackageProjectUrl>https://github.com/lepoco/wpfui</PackageProjectUrl>
23+
<PackageReleaseNotes>https://github.com/lepoco/wpfui/releases</PackageReleaseNotes>
2524
<RepositoryUrl>https://github.com/lepoco/wpfui</RepositoryUrl>
2625
<RepositoryBranch>main</RepositoryBranch>
2726
<RepositoryType>git</RepositoryType>
@@ -30,6 +29,10 @@
3029
<PackageReadmeFile>README.md</PackageReadmeFile>
3130
</PropertyGroup>
3231

32+
<PropertyGroup>
33+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
34+
</PropertyGroup>
35+
3336
<PropertyGroup>
3437
<NuGetAudit>true</NuGetAudit>
3538
<NuGetAuditLevel>moderate</NuGetAuditLevel>
@@ -52,4 +55,20 @@
5255
</AssemblyAttribute>
5356
</ItemGroup>
5457

58+
<Choose>
59+
<When Condition="'$(SourceLinkEnabled)' != 'false'">
60+
<PropertyGroup>
61+
<!-- Declare that the Repository URL can be published to NuSpec -->
62+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
63+
<!-- Embed source files that are not tracked by the source control manager to the PDB -->
64+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
65+
<!-- Include PDB in the built .nupkg -->
66+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
67+
</PropertyGroup>
68+
<ItemGroup>
69+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
70+
</ItemGroup>
71+
</When>
72+
</Choose>
73+
5574
</Project>

Directory.Build.targets

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Project>
2-
<Target Name="WpfSourceLinkWorkaround" BeforeTargets="InitializeSourceRootMappedPaths" Condition="'$(UseWPF)' == 'true'">
3-
<!-- WPF causes an error with SourceLink because its build targets create a temporary project without a PackageReference to SourceLink, see https://github.com/dotnet/sourcelink/issues/91,
2+
<Target Name="WpfSourceLinkWorkaround" BeforeTargets="InitializeSourceRootMappedPaths" Condition="'$(UseWPF)' == 'true'">
3+
<!-- WPF causes an error with SourceLink because its build targets create a temporary project without a PackageReference to SourceLink, see https://github.com/dotnet/sourcelink/issues/91,
44
causing the @SourceRoot property to be unexpectedly empty for the MapSourceRoot task
55
66
For context, see https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets
77
and https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/MSBuildTask/MapSourceRoots.cs
88
99
This workaround sets the SourceRoot manually to some deterministic value to keep the promise given by having DeterministicSourcePaths set to true -->
10-
<Message Text="using deterministic source path workaround for WPF project instead of SourceLink" />
11-
<ItemGroup>
12-
<!-- There needs to be at least one SourceRoot defined, its value does not seem to matter as long as it ends with a directory separator -->
13-
<SourceRoot Include="\" />
14-
</ItemGroup>
15-
</Target>
16-
</Project>
10+
<Message Text="using deterministic source path workaround for WPF project instead of SourceLink" />
11+
<ItemGroup>
12+
<!-- There needs to be at least one SourceRoot defined, its value does not seem to matter as long as it ends with a directory separator -->
13+
<SourceRoot Include="\" />
14+
</ItemGroup>
15+
</Target>
16+
</Project>

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2023 Leszek Pomianowski and WPF UI Contributors. https://dev.lepo.co/
3+
Copyright (c) 2021-2024 Leszek Pomianowski and WPF UI Contributors. https://dev.lepo.co/
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/docfx.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"_appName": "WPF UI",
4141
"_appFaviconPath": "images/favicon.ico",
4242
"_appLogoPath": "images/wpfui.png",
43-
"_appFooter": "<span>Made with <a href=\"https://dotnet.github.io/docfx\" rel=\"noreferrer\">docfx</a>, <a href=\"https://chat.openai.com/\" rel=\"noreferrer\">ChatGPT</a> and <a href=\"https://www.deepl.com/\" rel=\"noreferrer\">DeepL</a> | Copyright © 2023 <a href=\"https://dev.lepo.co/\">lepo.co</a></span>"
43+
"_appFooter": "<span>Made with <a href=\"https://dotnet.github.io/docfx\" rel=\"noreferrer\">docfx</a>, <a href=\"https://chat.openai.com/\" rel=\"noreferrer\">ChatGPT</a> and <a href=\"https://www.deepl.com/\" rel=\"noreferrer\">DeepL</a> | Copyright © 2024 <a href=\"https://dev.lepo.co/\">lepo.co</a></span>"
4444
},
4545
"dest": "_site",
4646
"template": ["default", "templates/wpfui"],

docs/templates/wpfui/layout/_master.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134

135135
<footer class="border-top">
136136
<div class="container-xxl">
137-
<div class="row"><div class="col-12">WPF UI<a target="_blank" rel="noopener nofollow noreferrer" href="https://github.com/lepoco/wpfui"><code> https://github.com/lepoco/wpfui </code></a></div><div class="col-12">Build with<a target="_blank" rel="noopener nofollow noreferrer" href="https://dotnet.github.io/docfx/"><code> docfx </code></a>using <a target="_blank" rel="noopener nofollow noreferrer" href="https://www.deepl.com/en/translator"><code> deepl</code></a><a target="_blank" rel="noopener nofollow noreferrer" href="https://highlightjs.org/"><code> highlight.js</code></a><a target="_blank" rel="noopener nofollow noreferrer" href="https://getbootstrap.com/"><code> bootstrap</code></a><a target="_blank" rel="noopener nofollow noreferrer" href="https://github.com/microsoft/fluentui-system-icons"><code> fluent-system-icons</code></a></div><div class="col-12">Copyright © 2023 lepo.co | Leszek Pomianowski</div></div>
137+
<div class="row"><div class="col-12">WPF UI<a target="_blank" rel="noopener nofollow noreferrer" href="https://github.com/lepoco/wpfui"><code> https://github.com/lepoco/wpfui </code></a></div><div class="col-12">Build with<a target="_blank" rel="noopener nofollow noreferrer" href="https://dotnet.github.io/docfx/"><code> docfx </code></a>using <a target="_blank" rel="noopener nofollow noreferrer" href="https://www.deepl.com/en/translator"><code> deepl</code></a><a target="_blank" rel="noopener nofollow noreferrer" href="https://highlightjs.org/"><code> highlight.js</code></a><a target="_blank" rel="noopener nofollow noreferrer" href="https://getbootstrap.com/"><code> bootstrap</code></a><a target="_blank" rel="noopener nofollow noreferrer" href="https://github.com/microsoft/fluentui-system-icons"><code> fluent-system-icons</code></a></div><div class="col-12">Copyright © 2024 lepo.co | Leszek Pomianowski</div></div>
138138
</div>
139139
</footer>
140140
</body>

nuget.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<configuration>
32
<packageRestore>
43
<add key="enabled" value="True" />
54
<add key="automatic" value="True" />
65
</packageRestore>
76

87
<packageSources>
8+
<clear />
99
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
1010
</packageSources>
1111

src/Wpf.Ui.Demo.Console/Program.cs

+4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
44
// All Rights Reserved.
55

6+
using System.Diagnostics;
7+
68
public static class Program
79
{
810
[STAThread]
911
public static void Main(string[] args)
1012
{
13+
Debug.WriteLine("Args: " + string.Join(", ", args));
14+
1115
if (Application.Current is null)
1216
{
1317
Console.WriteLine($"Application.Current is null.");

src/Wpf.Ui.Demo.Console/Utilities/ThemeUtilities.cs

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,27 @@ public static void ApplyTheme(this FrameworkElement frameworkElement)
1212
{
1313
ApplicationThemeManager.Apply(frameworkElement);
1414

15-
ThemeChangedEvent themeChanged = (sender, args) =>
15+
void themeChanged(ApplicationTheme sender, Color args)
1616
{
1717
ApplicationThemeManager.Apply(frameworkElement);
1818
if (frameworkElement is Window window)
1919
{
2020
if (window != UiApplication.Current.MainWindow)
21+
{
2122
WindowBackgroundManager.UpdateBackground(
2223
window,
2324
sender,
24-
Wpf.Ui.Controls.WindowBackdropType.None,
25-
true
25+
Wpf.Ui.Controls.WindowBackdropType.None
2626
);
27+
}
2728
}
28-
};
29+
}
2930

3031
if (frameworkElement.IsLoaded)
3132
{
3233
ApplicationThemeManager.Changed += themeChanged;
3334
}
35+
3436
frameworkElement.Loaded += (s, e) =>
3537
{
3638
ApplicationThemeManager.Changed += themeChanged;
@@ -85,6 +87,7 @@ public static void ChangeTheme()
8587
ApplicationThemeManager.Apply(applicationTheme, updateAccent: false);
8688
}
8789

90+
/*
8891
/// <summary>
8992
/// Applies Resources in the <paramref name="frameworkElement"/>.
9093
/// </summary>
@@ -128,4 +131,5 @@ private static void Apply(FrameworkElement frameworkElement)
128131
frameworkElement.Resources[resource.Key] = resource.Value;
129132
}
130133
}
134+
*/
131135
}

src/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Wpf.Ui.Demo.Console.Views.Pages;
1313
/// </summary>
1414
public partial class DataPage
1515
{
16-
public ObservableCollection<DataColor> ColorsCollection = new();
16+
public ObservableCollection<DataColor> ColorsCollection = [];
1717

1818
public DataPage()
1919
{
@@ -30,6 +30,7 @@ private void InitializeData()
3030
var random = new Random();
3131

3232
for (int i = 0; i < 8192; i++)
33+
{
3334
ColorsCollection.Add(
3435
new DataColor
3536
{
@@ -43,5 +44,6 @@ private void InitializeData()
4344
)
4445
}
4546
);
47+
}
4648
}
4749
}

src/Wpf.Ui.Demo.Console/Views/Pages/SettingsPage.xaml.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ private void OnDarkThemeRadioButtonChecked(object sender, RoutedEventArgs e)
4343
private string GetAssemblyVersion()
4444
{
4545
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString()
46-
?? String.Empty;
46+
?? string.Empty;
4747
}
4848
}

src/Wpf.Ui.Demo.Console/Wpf.Ui.Demo.Console.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net4.8</TargetFramework>
6-
<ImplicitUsings>false</ImplicitUsings>
7-
<Nullable>enable</Nullable>
86
<UseWPF>true</UseWPF>
97
<ApplicationIcon>wpfui.ico</ApplicationIcon>
108
<NoWarn>$(NoWarn);SA1601</NoWarn>
9+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1110
</PropertyGroup>
1211

1312
<ItemGroup>

0 commit comments

Comments
 (0)