Skip to content

Commit

Permalink
针对平台设置窗口大小
Browse files Browse the repository at this point in the history
  • Loading branch information
mujianwu committed Jul 30, 2024
1 parent 85d65de commit 2f9195c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions UotanToolbox/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Linq;
using System.Runtime.InteropServices;
using UotanToolbox.Common;
using UotanToolbox.Features;
using UotanToolbox.Services;
Expand All @@ -30,8 +31,16 @@ public override void OnFrameworkInitializationCompleted()
var mainVm = _provider?.GetRequiredService<MainViewModel>();

desktop.MainWindow = viewLocator?.Build(mainVm) as Window;
desktop.MainWindow.MinWidth = 1220;
desktop.MainWindow.MaxWidth = 1220;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
desktop.MainWindow.MinWidth = 1220;
desktop.MainWindow.MaxWidth = 1220;
}
else
{
desktop.MainWindow.MinWidth = 1235;
desktop.MainWindow.MaxWidth = 1235;
}
desktop.MainWindow.MaxHeight = 840;
desktop.MainWindow.Height = 840;
}
Expand Down

0 comments on commit 2f9195c

Please sign in to comment.