Back to Devexpress

ThemedWindow.UseNativeWindow Property

wpf-devexpress-dot-xpf-dot-core-dot-themedwindow-34e59f46.md

latest4.0 KB
Original Source

ThemedWindow.UseNativeWindow Property

Gets or sets whether the operating system’s native window is used to round a ThemedWindow instance’s corners.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public static bool UseNativeWindow { get; set; }
vb
Public Shared Property UseNativeWindow As Boolean

Property Value

TypeDescription
Boolean

true to use the operating system’s native window; otherwise, false.

|

Remarks

The following code sample sets the UseNativeWindow property to true to round ThemedWindow corners:

csharp
using DevExpress.Xpf.Core;
//...

public partial class App {
    protected override void OnStartup(StartupEventArgs e) {
        base.OnStartup(e);
        ThemedWindow.UseNativeWindow = true;  
    }
}
vb
Imports DevExpress.Xpf.Core

Public Partial Class App
    Protected Overrides Sub OnStartup(ByVal e As StartupEventArgs)
        MyBase.OnStartup(e)
        ThemedWindow.UseNativeWindow = True
    End Sub
End Class

DevExpress WPF Controls include the UseNativeWindow and ThemedWindow.RoundCorners properties that allow you to round window corners and replicate the Windows 11 application appearance.

The following table describes whether your application’s corners are rounded depending on your Windows version, applied DevExpress Theme, and the UseNativeWindow and RoundCorners property values:

|

Windows Version

|

Applied DevExpress Theme

|

UseNativeWindow

|

RoundCorners

| | --- | --- | --- | --- | |

true

|

false

|

true

|

false

| | --- | --- | --- | --- | |

Windows 11

|

Win11Light/Win11Dark

|

|

|

|

| |

non-Win11Light/Win11Dark

|

|

|

|

| |

Windows 10 and earlier

|

Win11Light/Win11Dark

|

[1]

|

|

|

| |

non-Win11Light/Win11Dark

|

|

|

|

|

Limitations

Footnotes

  1. Your application’s appearance will be broken.

See Also

ThemedWindow Class

ThemedWindow Members

DevExpress.Xpf.Core Namespace