Skip to content

Commit

Permalink
use toplevel instance to set the callbacks instead
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Sep 4, 2023
1 parent cf501f7 commit 9eb971e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Avalonia.Controls/Platform/Win32SpecificOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public class Win32SpecificOptions
/// <summary>
/// Sets a callback to set the window's style.
/// </summary>
/// <param name="topLevelImpl">The top level's <see cref="ITopLevelImpl"/> implementation</param>
/// <param name="topLevel">The window implementation</param>
/// <param name="callback">The callback</param>
public static void SetWindowStylesCallback(ITopLevelImpl topLevelImpl, CustomWindowStylesCallback? callback)
public static void SetWindowStylesCallback(TopLevel topLevel, CustomWindowStylesCallback? callback)
{
if (topLevelImpl is IWin32OptionsTopLevelImpl toplevelImpl)
if (topLevel.PlatformImpl is IWin32OptionsTopLevelImpl toplevelImpl)
{
toplevelImpl.WindowStylesCallback = callback;
}
Expand All @@ -27,11 +27,11 @@ public static void SetWindowStylesCallback(ITopLevelImpl topLevelImpl, CustomWin
/// <summary>
/// Sets a custom callback for the window's WndProc
/// </summary>
/// <param name="topLevelImpl"></param>
/// <param name="topLevel">The window</param>
/// <param name="callback"></param>
public static void SetWndProcHookCallback(ITopLevelImpl topLevelImpl, CustomWndProcHookCallback? callback)
public static void SetWndProcHookCallback(TopLevel topLevel, CustomWndProcHookCallback? callback)
{
if (topLevelImpl is IWin32OptionsTopLevelImpl toplevelImpl)
if (topLevel.PlatformImpl is IWin32OptionsTopLevelImpl toplevelImpl)
{
toplevelImpl.WndProcHookCallback = callback;
}
Expand Down

0 comments on commit 9eb971e

Please sign in to comment.