1- // Ported from https://github.com/lindexi/lindexi_gd/blob/master/KenafearcuweYemjecahee/FullScreenHelper .cs
1+ // Ported from https://github.com/lindexi/lindexi_gd/blob/master/KenafearcuweYemjecahee/FullscreenHelper .cs
22
33using System ;
44using System . Runtime . ExceptionServices ;
@@ -18,15 +18,15 @@ public static partial class FullscreenHelper
1818 /// <summary>
1919 /// Attached property to store window placement before entering fullscreen.
2020 /// </summary>
21- private static readonly DependencyProperty BeforeFullScreenWindowPlacementProperty =
22- DependencyProperty . RegisterAttached ( "BeforeFullScreenWindowPlacement " , typeof ( WINDOWPLACEMENT ? ) ,
21+ private static readonly DependencyProperty BeforeFullscreenWindowPlacementProperty =
22+ DependencyProperty . RegisterAttached ( "BeforeFullscreenWindowPlacement " , typeof ( WINDOWPLACEMENT ? ) ,
2323 typeof ( Window ) ) ;
2424
2525 /// <summary>
2626 /// Attached property to store window style before entering fullscreen.
2727 /// </summary>
28- private static readonly DependencyProperty BeforeFullScreenWindowStyleProperty =
29- DependencyProperty . RegisterAttached ( "BeforeFullScreenWindowStyle " , typeof ( WindowStyles ? ) , typeof ( Window ) ) ;
28+ private static readonly DependencyProperty BeforeFullscreenWindowStyleProperty =
29+ DependencyProperty . RegisterAttached ( "BeforeFullscreenWindowStyle " , typeof ( WindowStyles ? ) , typeof ( Window ) ) ;
3030
3131 /// <summary>
3232 /// Start fullscreen mode.
@@ -35,16 +35,16 @@ public static partial class FullscreenHelper
3535 /// DWM transition animations are disabled in fullscreen mode.
3636 /// </summary>
3737 /// <param name="window"></param>
38- public static void StartFullScreen ( Window window )
38+ public static void StartFullscreen ( Window window )
3939 {
4040 if ( window == null )
4141 {
4242 throw new ArgumentNullException ( nameof ( window ) , $ "{ nameof ( window ) } cannot be null") ;
4343 }
4444
4545 // Ensure not already in fullscreen mode
46- if ( window . GetValue ( BeforeFullScreenWindowPlacementProperty ) == null &&
47- window . GetValue ( BeforeFullScreenWindowStyleProperty ) == null )
46+ if ( window . GetValue ( BeforeFullscreenWindowPlacementProperty ) == null &&
47+ window . GetValue ( BeforeFullscreenWindowStyleProperty ) == null )
4848 {
4949 var hwnd = new WindowInteropHelper ( window ) . EnsureHandle ( ) ;
5050 var hwndSource = HwndSource . FromHwnd ( hwnd ) ;
@@ -53,11 +53,11 @@ public static void StartFullScreen(Window window)
5353 var placement = new WINDOWPLACEMENT ( ) ;
5454 placement . Size = ( uint ) Marshal . SizeOf ( placement ) ;
5555 Win32 . User32 . GetWindowPlacement ( hwnd , ref placement ) ;
56- window . SetValue ( BeforeFullScreenWindowPlacementProperty , placement ) ;
56+ window . SetValue ( BeforeFullscreenWindowPlacementProperty , placement ) ;
5757
5858 // Modify window style
5959 var style = ( WindowStyles ) Win32 . User32 . GetWindowLongPtr ( hwnd , GetWindowLongFields . GWL_STYLE ) ;
60- window . SetValue ( BeforeFullScreenWindowStyleProperty , style ) ;
60+ window . SetValue ( BeforeFullscreenWindowStyleProperty , style ) ;
6161 // Restore window to normal state; cannot fullscreen with title bar in maximized mode.
6262 // Use restore, do not modify title bar.
6363 // On exit, original state will be restored.
@@ -72,7 +72,7 @@ public static void StartFullScreen(Window window)
7272 sizeof ( int ) ) ;
7373
7474 // Add hook to keep window fullscreen when position/size changes
75- hwndSource . AddHook ( KeepFullScreenHook ) ;
75+ hwndSource . AddHook ( KeepFullscreenHook ) ;
7676
7777 if ( Win32 . User32 . GetWindowRect ( hwnd , out var rect ) )
7878 {
@@ -91,24 +91,24 @@ public static void StartFullScreen(Window window)
9191 /// DWM transition animations are re-enabled after exiting fullscreen.
9292 /// </summary>
9393 /// <param name="window"></param>
94- public static void EndFullScreen ( Window window )
94+ public static void EndFullscreen ( Window window )
9595 {
9696 if ( window == null )
9797 {
9898 throw new ArgumentNullException ( nameof ( window ) , $ "{ nameof ( window ) } cannot be null") ;
9999 }
100100
101101 // Ensure in fullscreen mode and get previously saved state
102- if ( window . GetValue ( BeforeFullScreenWindowPlacementProperty ) is WINDOWPLACEMENT placement
103- && window . GetValue ( BeforeFullScreenWindowStyleProperty ) is WindowStyles style )
102+ if ( window . GetValue ( BeforeFullscreenWindowPlacementProperty ) is WINDOWPLACEMENT placement
103+ && window . GetValue ( BeforeFullscreenWindowStyleProperty ) is WindowStyles style )
104104 {
105105 var hwnd = new WindowInteropHelper ( window ) . Handle ;
106106
107107 if ( hwnd == IntPtr . Zero )
108108 {
109109 // Handle is zero in two cases:
110110 //1. Window was closed after entering fullscreen.
111- //2. Called before window initialization and before StartFullScreen .
111+ //2. Called before window initialization and before StartFullscreen .
112112 // Just return in both cases.
113113 return ;
114114 }
@@ -117,7 +117,7 @@ public static void EndFullScreen(Window window)
117117 var hwndSource = HwndSource . FromHwnd ( hwnd ) ;
118118
119119 // Remove hook
120- hwndSource . RemoveHook ( KeepFullScreenHook ) ;
120+ hwndSource . RemoveHook ( KeepFullscreenHook ) ;
121121
122122 // Restore saved state
123123 // Do not change WS_MAXIMIZE in style, or window will maximize with incorrect size
@@ -166,8 +166,8 @@ public static void EndFullScreen(Window window)
166166 sizeof ( int ) ) ;
167167
168168 // Clear saved state
169- window . ClearValue ( BeforeFullScreenWindowPlacementProperty ) ;
170- window . ClearValue ( BeforeFullScreenWindowStyleProperty ) ;
169+ window . ClearValue ( BeforeFullscreenWindowPlacementProperty ) ;
170+ window . ClearValue ( BeforeFullscreenWindowStyleProperty ) ;
171171 }
172172 }
173173
@@ -176,7 +176,7 @@ public static void EndFullScreen(Window window)
176176 /// Uses HandleProcessCorruptedStateExceptions to prevent crashes from fatal exceptions during memory access.
177177 /// </summary>
178178 // [HandleProcessCorruptedStateExceptions]
179- private static IntPtr KeepFullScreenHook ( IntPtr hwnd , int msg , IntPtr wParam , IntPtr lParam , ref bool handled )
179+ private static IntPtr KeepFullscreenHook ( IntPtr hwnd , int msg , IntPtr wParam , IntPtr lParam , ref bool handled )
180180 {
181181 // Handle WM_WINDOWPOSCHANGING message
182182 const int WINDOWPOSCHANGING = 0x0046 ;
0 commit comments