refactor: 重构待办事项模块结构与命名
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui.ApplicationModel;
|
||||
|
||||
namespace Hua.Todo.Maui.Views
|
||||
{
|
||||
@@ -30,5 +31,53 @@ namespace Hua.Todo.Maui.Views
|
||||
var windowService = new Platforms.Windows.WindowsWindowService();
|
||||
windowService.MinimizeWindow(window);
|
||||
}
|
||||
|
||||
partial void PlatformPrepareWebViewContainer()
|
||||
{
|
||||
if (Platforms.Windows.WebView2RuntimeDetector.IsRuntimeInstalled(out _))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isWebViewContainerReady = false;
|
||||
|
||||
var downloadUrl = "https://developer.microsoft.com/microsoft-edge/webview2/";
|
||||
var content = new VerticalStackLayout
|
||||
{
|
||||
Padding = new Thickness(20),
|
||||
Spacing = 12,
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = "检测到系统未安装 WebView2 Runtime,无法加载主界面。",
|
||||
FontSize = 16
|
||||
},
|
||||
new Label
|
||||
{
|
||||
Text = "请安装 Microsoft Edge WebView2 Runtime(Evergreen),安装完成后重新打开应用。",
|
||||
Opacity = 0.85
|
||||
},
|
||||
new Button
|
||||
{
|
||||
Text = "打开下载页面",
|
||||
Command = new Command(async () =>
|
||||
{
|
||||
await Launcher.Default.OpenAsync(downloadUrl);
|
||||
})
|
||||
},
|
||||
new Button
|
||||
{
|
||||
Text = "退出应用",
|
||||
Command = new Command(() =>
|
||||
{
|
||||
Microsoft.Maui.Controls.Application.Current?.Quit();
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Content = new ScrollView { Content = content };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user