Skip to content

Commit ec981ae

Browse files
authored
Merge branch 'main' into datagrid-issues-fix
2 parents 01aacf9 + 397739b commit ec981ae

22 files changed

+158
-33
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WPF UI Docs Dev Container",
3-
"image": "mcr.microsoft.com/dotnet/sdk:8.0",
3+
"image": "mcr.microsoft.com/dotnet/sdk:9.0",
44
"features": {
55
"ghcr.io/devcontainers/features/node:1": {
66
"version": "20"
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: wpf-ui-top-issues-dashboard
2+
on:
3+
schedule:
4+
- cron: '0 0 */1 * *'
5+
6+
jobs:
7+
ShowAndLabelTopIssues:
8+
name: Display and label top issues.
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Top Issues action
12+
uses: rickstaa/[email protected]
13+
env:
14+
github_token: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
top_list_size: 10
17+
label: true
18+
dashboard: true
19+
dashboard_show_total_reactions: true
20+
top_issues: true
21+
top_bugs: true
22+
top_features: true
23+
feature_label: feature
24+
top_pull_requests: true

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
uses: actions/setup-node@v4
3434
with:
3535
node-version: 18.x
36-
- name: Setup .NET Core SDK 8.x
36+
- name: Setup .NET Core SDK 9.x
3737
uses: actions/setup-dotnet@v4
3838
with:
39-
dotnet-version: 8.x
39+
dotnet-version: 9.x
4040

4141
- name: Install docfx
4242
run: dotnet tool update -g docfx

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- 'src/Wpf.Ui.Extension**`
7+
- 'src/Wpf.Ui.Extension**'
88

99
workflow_dispatch:
1010

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: wpf-ui-cd-nuget
33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- 'src/**'
68

79
workflow_dispatch:
810

@@ -17,10 +19,10 @@ jobs:
1719
- uses: nuget/setup-nuget@v2
1820
with:
1921
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
20-
- name: Setup .NET Core SDK 8.x
22+
- name: Setup .NET Core SDK 9.x
2123
uses: actions/setup-dotnet@v4
2224
with:
23-
dotnet-version: 8.x
25+
dotnet-version: 9.x
2426

2527
- name: Fetch the certificate
2628
run: |

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- uses: nuget/setup-nuget@v2
1818
with:
1919
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
20-
- name: Setup .NET Core SDK 8.x
20+
- name: Setup .NET Core SDK 9.x
2121
uses: actions/setup-dotnet@v4
2222
with:
23-
dotnet-version: 8.x
23+
dotnet-version: 9.x
2424

2525
- name: Install dependencies
2626
run: dotnet restore

Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<PropertyGroup>
9-
<Version>4.0.0-rc.2</Version>
9+
<Version>4.0.0-rc.3</Version>
1010
<AssemblyVersion>4.0.0</AssemblyVersion>
1111
</PropertyGroup>
1212

@@ -41,7 +41,7 @@
4141

4242
<PropertyGroup>
4343
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
44-
<LangVersion>12.0</LangVersion>
44+
<LangVersion>13.0</LangVersion>
4545
<Nullable>enable</Nullable>
4646

4747
<!--

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Support the development of WPF UI and other innovative projects by becoming a sp
2929
[Sponsor WPF UI on GitHub](https://github.com/sponsors/lepoco)
3030

3131
## 🚀 Getting started
32-
ąś
32+
3333
For a starter guide see our [documentation](https://wpfui.lepo.co/documentation/).
3434

3535
**WPF UI Gallery** is a free application available in the _Microsoft Store_, with which you can test all functionalities.

docs/documentation/getting-started.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
## Adding dictionaries
44

5-
[XAML](https://docs.microsoft.com/en-us/dotnet/desktop/wpf/xaml/?view=netdesktop-6.0), and hence WPF, operate on resource dictionaries. These are HTML-like files that describe the appearance and various aspects of the [controls](https://wpfui.lepo.co/documentation/controls).
6-
**WPF UI** adds its own sets of these files to tell the application how the controls should look like.
5+
[XAML](https://docs.microsoft.com/en-us/dotnet/desktop/wpf/xaml/?view=netdesktop-6.0), and hence WPF, operate on resource dictionaries. These are HTML-like files that describe the appearance and various aspects of the [controls](https://wpfui.lepo.co/documentation/controls). **WPF UI** adds its own sets of these files to tell the application how the controls should look.
76

87
There should be a file called `App.xaml` in your new application. Add new dictionaries to it using **WPF UI** `ControlsDictionary` and `ThemesDictionary` classes:
98

@@ -20,16 +19,13 @@ There should be a file called `App.xaml` in your new application. Add new dictio
2019
</ResourceDictionary>
2120
</Application.Resources>
2221
</Application>
23-
2422
```
2523

26-
You can choose a color theme here,
27-
`Light` or `Dark`.
24+
Notice that the `ThemeDictionary` lets you choose a color theme, `Light` or `Dark`.
2825

2926
## The main window
3027

31-
There should be a `MainWindow.xaml` file in your newly created application.
32-
It contains the arrangement of the controls used and their parameters.
28+
There should be a `MainWindow.xaml` file in your newly created application. It contains the arrangement of the controls used and their parameters.
3329

3430
```xml
3531
<Window x:Class="WpfApp1.MainWindow"
@@ -46,7 +42,7 @@ It contains the arrangement of the controls used and their parameters.
4642
</Window>
4743
```
4844

49-
You can add a new namespace to this window to tell the interpreter that you will be using controls from somewhere, like the **WPF UI** library.
45+
Add the **WPF UI** library namespace to this window to tell the XAML compiler that you will be using controls from the library.
5046

5147
```xml
5248
<Window
@@ -56,7 +52,7 @@ You can add a new namespace to this window to tell the interpreter that you will
5652

5753
## Adding controls
5854

59-
To add a new control from the **WPF UI** library, you just need to enter its class name, prefixing it with the `ui:` prefix:
55+
To add a new control from the **WPF UI** library, just enter its class name, prefixing it with the `ui:` prefix:
6056

6157
```xml
6258
<Window x:Class="WpfApp1.MainWindow"
@@ -76,5 +72,6 @@ To add a new control from the **WPF UI** library, you just need to enter its cla
7672

7773
# Well...
7874

79-
That's it when it comes to the basics, information about individual controls can be found in [documentation](https://wpfui.lepo.co/documentation/), rules for building a WPF application can be found in the [official Microsoft documentation](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/styles-templates-overview?view=netdesktop-6.0). You can check out [**how to build MVVM applications** here](https://learn.microsoft.com/en-us/windows/communitytoolkit/mvvm/puttingthingstogether).
80-
If you think this documentation sucks, [help improve it here](https://github.com/lepoco/wpfui/tree/development/docs/tutorial).
75+
That's it when it comes to the basics, information about individual controls can be found in [documentation](https://wpfui.lepo.co/documentation/). Rules for building a WPF application can be found in the [official Microsoft documentation](https://learn.microsoft.com/en-us/dotnet/desktop/wpf/controls/styles-templates-overview?view=netdesktop-6.0). You can check out [**how to build MVVM applications** here](https://learn.microsoft.com/en-us/windows/communitytoolkit/mvvm/puttingthingstogether).
76+
77+
If you think this documentation needs improvement, please [help improve it here](https://github.com/lepoco/wpfui/tree/development/docs/tutorial).
+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SystemThemeWatcher
2+
3+
SystemThemeWatcher automatically updates the application background if the system theme or color changes. This component is used to adapt the application's background effect and theme according to the system theme.
4+
5+
## Features
6+
7+
* Automatic Theme Updates: Updates the application's background and theme when the system theme changes.
8+
9+
* Global Settings: Settings apply globally and cannot be changed for each System.Windows.Window.
10+
11+
* Supported Backdrop Types: Provides background effects compatible with WindowBackdropType types (e.g., Egg).
12+
13+
14+
## Usage
15+
16+
You can use SystemThemeWatcher to start watching a window's background and theme like this:
17+
18+
```cs
19+
SystemThemeWatcher.Watch(this as System.Windows.Window);
20+
SystemThemeWatcher.UnWatch(this as System.Windows.Window);
21+
```
22+
23+
or
24+
```cs
25+
SystemThemeWatcher.Watch(
26+
_serviceProvider.GetRequiredService<MainWindow>()
27+
);
28+
```
29+
30+
## Example Usage
31+
32+
Here's an example of using SystemThemeWatcher in the MainWindow class to start watching the theme when the window is loaded:
33+
34+
```cs
35+
namespace MyApp;
36+
37+
public partial class MainWindow : Window
38+
{
39+
public MainWindow()
40+
{
41+
InitializeComponent();
42+
43+
Loaded += (sender, args) =>
44+
{
45+
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(
46+
this, // Window class
47+
Wpf.Ui.Controls.WindowBackdropType.Mica, // Background type
48+
true // Whether to change accents automatically
49+
);
50+
};
51+
}
52+
}
53+
```
54+
55+
## Methods
56+
57+
### Watch
58+
59+
Applies the background effect and theme according to the system theme to the observed window.
60+
61+
```cs
62+
public static void Watch(
63+
Window? window,
64+
WindowBackdropType backdrop = WindowBackdropType.Mica,
65+
bool updateAccents = true
66+
)
67+
```
68+
69+
### UnWatch
70+
71+
Stops watching the window and removes the hook to receive system messages.
72+
73+
```cs
74+
public static void UnWatch(Window? window)
75+
76+
```
77+
78+
### WndProc
79+
80+
Listens to system messages on the application windows.
81+
82+
```cs
83+
private static IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
84+
85+
```
86+
87+
> [!IMPORTANT]
88+
> If UnWatch is called on a window that has not yet loaded, an InvalidOperationException may occur. Ensure that the window is loaded before calling UnWatch.

src/Wpf.Ui.Abstractions/Wpf.Ui.Abstractions.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>WPF-UI.Abstractions</PackageId>
5-
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net472;net6.0;net8.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net472;net6.0;net8.0;net9.0</TargetFrameworks>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
<Description>Abstractions for the WPF UI.</Description>
88
<CommonTags>$(CommonTags);abstractions;standard</CommonTags>

src/Wpf.Ui.DependencyInjection/Wpf.Ui.DependencyInjection.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>WPF-UI.DependencyInjection</PackageId>
5-
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net472;net6.0;net8.0</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net472;net6.0;net8.0;net9.0</TargetFrameworks>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
<Description>Dependency injection for the WPF UI.</Description>
88
<CommonTags>$(CommonTags);dependency;injection;abstractions;standard</CommonTags>
@@ -24,4 +24,4 @@
2424
<ProjectReference Include="..\Wpf.Ui.Abstractions\Wpf.Ui.Abstractions.csproj" />
2525
</ItemGroup>
2626

27-
</Project>
27+
</Project>

src/Wpf.Ui.FontMapper/Wpf.Ui.FontMapper.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

src/Wpf.Ui.Gallery/Wpf.Ui.Gallery.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<RootNamespace>Wpf.Ui.Gallery</RootNamespace>
55
<OutputType>WinExe</OutputType>
6-
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
6+
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
77
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
88
<UseWPF>true</UseWPF>
99
<EnableWindowsTargeting>true</EnableWindowsTargeting>

src/Wpf.Ui.SyntaxHighlight/Wpf.Ui.SyntaxHighlight.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>WPF-UI.SyntaxHighlight</PackageId>
5-
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows</TargetFrameworks>
5+
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows;net9.0-windows</TargetFrameworks>
66
<Description>Native tast notification support for WPF using the WPF UI library.</Description>
77
<CommonTags>$(CommonTags);syntax;highlight</CommonTags>
88
<UseWPF>true</UseWPF>

src/Wpf.Ui.ToastNotifications/Wpf.Ui.ToastNotifications.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>WPF-UI.ToastNotifications</PackageId>
5-
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows</TargetFrameworks>
5+
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows;net9.0-windows</TargetFrameworks>
66
<Description>Native tast notification support for WPF using the WPF UI library.</Description>
77
<CommonTags>$(CommonTags);toast;notifications</CommonTags>
88
<UseWPF>true</UseWPF>

src/Wpf.Ui.Tray/Wpf.Ui.Tray.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>WPF-UI.Tray</PackageId>
5-
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows</TargetFrameworks>
5+
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows;net9.0-windows</TargetFrameworks>
66
<Description>Native tray menu icon support for WPF using the WPF UI library.</Description>
77
<CommonTags>$(CommonTags);tray;notifyicon;notify</CommonTags>
88
<UseWPF>true</UseWPF>

src/Wpf.Ui/Controls/MessageBox/MessageBox.cs

+2
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,12 @@ public bool IsPrimaryButtonEnabled
236236
/// </summary>
237237
public IRelayCommand TemplateButtonCommand => (IRelayCommand)GetValue(TemplateButtonCommandProperty);
238238

239+
#if !NET8_0_OR_GREATER
239240
private static readonly PropertyInfo CanCenterOverWPFOwnerPropertyInfo = typeof(Window).GetProperty(
240241
"CanCenterOverWPFOwner",
241242
BindingFlags.NonPublic | BindingFlags.Instance
242243
)!;
244+
#endif
243245

244246
/// <summary>
245247
/// Initializes a new instance of the <see cref="MessageBox"/> class.

src/Wpf.Ui/Controls/NavigationView/NavigationViewContentPresenter.cs

+12
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,23 @@ protected override void OnMouseDown(MouseButtonEventArgs e)
140140
if (e.ChangedButton is MouseButton.XButton1 or MouseButton.XButton2)
141141
{
142142
e.Handled = true;
143+
return;
143144
}
144145

145146
base.OnMouseDown(e);
146147
}
147148

149+
protected override void OnPreviewKeyDown(KeyEventArgs e)
150+
{
151+
if (e.Key == Key.F5)
152+
{
153+
e.Handled = true;
154+
return;
155+
}
156+
157+
base.OnPreviewKeyDown(e);
158+
}
159+
148160
protected virtual void OnNavigating(System.Windows.Navigation.NavigatingCancelEventArgs eventArgs)
149161
{
150162
NotifyContentAboutNavigatingTo(eventArgs.Content);

src/Wpf.Ui/Wpf.Ui.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageId>WPF-UI</PackageId>
5-
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows</TargetFrameworks>
5+
<TargetFrameworks>net462;net472;net481;net6.0-windows;net8.0-windows;net9.0-windows</TargetFrameworks>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
<Description>WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.</Description>
88
<UseWPF>true</UseWPF>

tests/Wpf.Ui.Gallery.UnitTests/Wpf.Ui.Gallery.UnitTests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
4+
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

tests/Wpf.Ui.UnitTests/Wpf.Ui.UnitTests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0-windows</TargetFramework>
4+
<TargetFramework>net9.0-windows</TargetFramework>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)