27 lines
702 B
C#
27 lines
702 B
C#
|
using Avalonia.Controls;
|
|||
|
|
|||
|
namespace ZTools.Helper;
|
|||
|
|
|||
|
public static class CommonHelper
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 设置窗口类型:正常/最小/最大/全屏
|
|||
|
/// </summary>
|
|||
|
/// <param name="window"></param>
|
|||
|
/// <param name="state"></param>
|
|||
|
public static void SetWindowsState(this Window window, WindowState state)
|
|||
|
{
|
|||
|
window.WindowState = state;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 设置窗口无边框
|
|||
|
/// </summary>
|
|||
|
/// <param name="window"></param>
|
|||
|
public static void SetWindowsStyle(this Window window)
|
|||
|
{
|
|||
|
// 设置无边框
|
|||
|
window.ExtendClientAreaToDecorationsHint = true;
|
|||
|
window.ExtendClientAreaTitleBarHeightHint = 0;
|
|||
|
}
|
|||
|
}
|