Skip to content

Merge development and bump version #1051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ file_header_template = This Source Code Form is subject to the terms of the MIT
#### .NET Coding Conventions ####

# this. and Me. preferences
dotnet_style_qualification_for_event = false:warning
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_event = false:silent
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_property = false:silent

# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
Expand Down Expand Up @@ -95,8 +95,8 @@ dotnet_style_readonly_field = true:warning

# var preferences
csharp_style_var_elsewhere = false:warning
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = false:warning
csharp_style_var_for_built_in_types = false:none
csharp_style_var_when_type_is_apparent = false:none

# Expression-bodied members
csharp_style_expression_bodied_accessors = false:silent
Expand Down Expand Up @@ -388,7 +388,7 @@ dotnet_diagnostic.SA1633.severity = none
dotnet_diagnostic.SA1634.severity = none
dotnet_diagnostic.SA1652.severity = none

dotnet_diagnostic.IDE0009.severity = none


# Additional Stylecop Analyzers
dotnet_diagnostic.SA1111.severity = none
Expand All @@ -397,3 +397,19 @@ dotnet_diagnostic.SA1204.severity = none
dotnet_diagnostic.SA1208.severity = none
dotnet_diagnostic.SA1518.severity = none
dotnet_diagnostic.SA1615.severity = none
dotnet_diagnostic.SA1502.severity = none
dotnet_diagnostic.SA1010.severity = none # Opening square brackets should not be preceded by a space
# conflicts with collection expressions and IDE0028

# Suppress some ValueConverter warnings
dotnet_diagnostic.WPF0073.severity = none # Add ValueConversion attribute (unknown types)
dotnet_diagnostic.WPF0071.severity = none # Add ValueConversion attribute
dotnet_diagnostic.WPF0070.severity = none # Add default field to converter

# Suppress some IDE warnings
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
# 15000+ warnings in the solution
dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException throw helper
# doesn't work with older versions of .NET

4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ themes:
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui/Appearance/**'

titlebar:
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui/Controls/TitleBar/**'

tray:
- changed-files:
- any-glob-to-any-file: 'src/Wpf.Ui.Tray/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-cd-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v5
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-cd-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.3
- uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- uses: nuget/setup-nuget@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wpf-ui-cd-nuget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.3
- uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- uses: nuget/setup-nuget@v2
Expand All @@ -26,10 +26,10 @@ jobs:
run: dotnet restore

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

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

- name: Publish the package to NuGet.org
run: nuget push **\*.nupkg -NonInteractive -SkipDuplicate -Source 'https://api.nuget.org/v3/index.json'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wpf-ui-pr-validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.3
- uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- uses: nuget/setup-nuget@v2
Expand Down
35 changes: 27 additions & 8 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>3.0.3</Version>
<Version>3.0.4</Version>
<LangVersion>12.0</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>

<PropertyGroup>
<Authors>lepo.co</Authors>
<Company>lepo.co</Company>
<Copyright>Copyright (C) 2021-2024 Leszek Pomianowski and WPF UI Contributors</Copyright>
</PropertyGroup>

<PropertyGroup>
<PackagesCommonFrameworks>net8.0-windows;net7.0-windows;net6.0-windows;net481;net472;net462</PackagesCommonFrameworks>
</PropertyGroup>

<PropertyGroup>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageVersion>$(Version)</PackageVersion>
<Authors>lepo.co</Authors>
<Company>lepo.co</Company>
<Copyright>Copyright (C) 2021-2024 Leszek Pomianowski and WPF UI Contributors</Copyright>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageLicense>https://raw.githubusercontent.com/lepoco/wpfui/main/LICENSE</PackageLicense>
<PackageProjectUrl>https://github.com/lepoco/wpfui</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/lepoco/wpfui/releases</PackageReleaseNotes>
<RepositoryUrl>https://github.com/lepoco/wpfui</RepositoryUrl>
<RepositoryBranch>main</RepositoryBranch>
<RepositoryType>git</RepositoryType>
Expand All @@ -30,6 +29,10 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<PropertyGroup>
<NuGetAudit>true</NuGetAudit>
<NuGetAuditLevel>moderate</NuGetAuditLevel>
Expand All @@ -52,4 +55,20 @@
</AssemblyAttribute>
</ItemGroup>

<Choose>
<When Condition="'$(SourceLinkEnabled)' != 'false'">
<PropertyGroup>
<!-- Declare that the Repository URL can be published to NuSpec -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Embed source files that are not tracked by the source control manager to the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Include PDB in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
</When>
</Choose>

</Project>
18 changes: 9 additions & 9 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project>
<Target Name="WpfSourceLinkWorkaround" BeforeTargets="InitializeSourceRootMappedPaths" Condition="'$(UseWPF)' == 'true'">
<!-- 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,
<Target Name="WpfSourceLinkWorkaround" BeforeTargets="InitializeSourceRootMappedPaths" Condition="'$(UseWPF)' == 'true'">
<!-- 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,
causing the @SourceRoot property to be unexpectedly empty for the MapSourceRoot task

For context, see https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/MSBuildTask/Microsoft.Managed.Core.targets
and https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/MSBuildTask/MapSourceRoots.cs

This workaround sets the SourceRoot manually to some deterministic value to keep the promise given by having DeterministicSourcePaths set to true -->
<Message Text="using deterministic source path workaround for WPF project instead of SourceLink" />
<ItemGroup>
<!-- 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 -->
<SourceRoot Include="\" />
</ItemGroup>
</Target>
</Project>
<Message Text="using deterministic source path workaround for WPF project instead of SourceLink" />
<ItemGroup>
<!-- 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 -->
<SourceRoot Include="\" />
</ItemGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"_appName": "WPF UI",
"_appFaviconPath": "images/favicon.ico",
"_appLogoPath": "images/wpfui.png",
"_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>"
"_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>"
},
"dest": "_site",
"template": ["default", "templates/wpfui"],
Expand Down
2 changes: 1 addition & 1 deletion docs/templates/wpfui/layout/_master.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

<footer class="border-top">
<div class="container-xxl">
<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>
<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>
</div>
</footer>
</body>
Expand Down
2 changes: 1 addition & 1 deletion nuget.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>

<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>

Expand Down
4 changes: 4 additions & 0 deletions src/Wpf.Ui.Demo.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using System.Diagnostics;

public static class Program
{
[STAThread]
public static void Main(string[] args)
{
Debug.WriteLine("Args: " + string.Join(", ", args));

if (Application.Current is null)
{
Console.WriteLine($"Application.Current is null.");
Expand Down
12 changes: 8 additions & 4 deletions src/Wpf.Ui.Demo.Console/Utilities/ThemeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ public static void ApplyTheme(this FrameworkElement frameworkElement)
{
ApplicationThemeManager.Apply(frameworkElement);

ThemeChangedEvent themeChanged = (sender, args) =>
void themeChanged(ApplicationTheme sender, Color args)
{
ApplicationThemeManager.Apply(frameworkElement);
if (frameworkElement is Window window)
{
if (window != UiApplication.Current.MainWindow)
{
WindowBackgroundManager.UpdateBackground(
window,
sender,
Wpf.Ui.Controls.WindowBackdropType.None,
true
Wpf.Ui.Controls.WindowBackdropType.None
);
}
}
};
}

if (frameworkElement.IsLoaded)
{
ApplicationThemeManager.Changed += themeChanged;
}

frameworkElement.Loaded += (s, e) =>
{
ApplicationThemeManager.Changed += themeChanged;
Expand Down Expand Up @@ -85,6 +87,7 @@ public static void ChangeTheme()
ApplicationThemeManager.Apply(applicationTheme, updateAccent: false);
}

/*
/// <summary>
/// Applies Resources in the <paramref name="frameworkElement"/>.
/// </summary>
Expand Down Expand Up @@ -128,4 +131,5 @@ private static void Apply(FrameworkElement frameworkElement)
frameworkElement.Resources[resource.Key] = resource.Value;
}
}
*/
}
4 changes: 3 additions & 1 deletion src/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Wpf.Ui.Demo.Console.Views.Pages;
/// </summary>
public partial class DataPage
{
public ObservableCollection<DataColor> ColorsCollection = new();
public ObservableCollection<DataColor> ColorsCollection = [];

public DataPage()
{
Expand All @@ -30,6 +30,7 @@ private void InitializeData()
var random = new Random();

for (int i = 0; i < 8192; i++)
{
ColorsCollection.Add(
new DataColor
{
Expand All @@ -43,5 +44,6 @@ private void InitializeData()
)
}
);
}
}
}
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Demo.Console/Views/Pages/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ private void OnDarkThemeRadioButtonChecked(object sender, RoutedEventArgs e)
private string GetAssemblyVersion()
{
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version?.ToString()
?? String.Empty;
?? string.Empty;
}
}
3 changes: 1 addition & 2 deletions src/Wpf.Ui.Demo.Console/Wpf.Ui.Demo.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net4.8</TargetFramework>
<ImplicitUsings>false</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ApplicationIcon>wpfui.ico</ApplicationIcon>
<NoWarn>$(NoWarn);SA1601</NoWarn>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading