From 0433ecbce8d7c3fa9c3200d61812f828e67203d2 Mon Sep 17 00:00:00 2001 From: Lightczx <1686188646@qq.com> Date: Tue, 25 Jun 2024 17:24:36 +0800 Subject: [PATCH] refactor --- .../Core/LifeCycle/AppActivation.cs | 6 +- src/Snap.Hutao/Snap.Hutao/Program.cs | 2 + .../GachaLogQueryManualInputProvider.cs | 2 +- .../Game/Account/GameAccountService.cs | 2 +- ...aunchExecutionEnsureGameResourceHandler.cs | 2 +- .../Unlocker/Island/IslandEnvironmentView.cs | 15 ++ .../Unlocker/Island/IslandGameFpsUnlocker.cs | 8 +- .../Service/Navigation/NavigationService.cs | 9 +- src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj | 183 ++++-------------- .../UI/Xaml/Control/Card/CardBlock.xaml | 6 +- .../Xaml/Control/NavigationViewItemHelper.cs} | 9 +- .../Snap.Hutao/UI/Xaml/Control/ScopedPage.cs | 7 +- .../Control/Theme/TransitionCollection.xaml | 9 +- .../Converter/VisibilityToObjectConverter.cs | 2 +- .../Helper => UI/Xaml}/DeferContentLoader.cs | 12 +- .../Helper => UI/Xaml}/IDeferContentLoader.cs | 2 +- .../Snap.Hutao/UI/Xaml/UIElementHelper.cs | 7 + .../Xaml}/View/Card/AchievementCard.xaml | 2 +- .../Xaml}/View/Card/AchievementCard.xaml.cs | 9 +- .../Xaml}/View/Card/DailyNoteCard.xaml | 4 +- .../Xaml}/View/Card/DailyNoteCard.xaml.cs | 3 +- .../Xaml}/View/Card/GachaStatisticsCard.xaml | 2 +- .../View/Card/GachaStatisticsCard.xaml.cs | 3 +- .../Xaml}/View/Card/LaunchGameCard.xaml | 2 +- .../Xaml}/View/Card/LaunchGameCard.xaml.cs | 5 +- .../AchievementArchiveCreateDialog.xaml | 2 +- .../AchievementArchiveCreateDialog.xaml.cs | 2 +- .../View/Dialog/AchievementImportDialog.xaml | 2 +- .../Dialog/AchievementImportDialog.xaml.cs | 2 +- .../View/Dialog/CultivateProjectDialog.xaml | 2 +- .../Dialog/CultivateProjectDialog.xaml.cs | 2 +- .../CultivatePromotionDeltaBatchDialog.xaml | 6 +- ...CultivatePromotionDeltaBatchDialog.xaml.cs | 2 +- .../Dialog/CultivatePromotionDeltaDialog.xaml | 2 +- .../CultivatePromotionDeltaDialog.xaml.cs | 2 +- .../Dialog/DailyNoteNotificationDialog.xaml | 2 +- .../DailyNoteNotificationDialog.xaml.cs | 2 +- .../View/Dialog/DailyNoteWebhookDialog.xaml | 2 +- .../Dialog/DailyNoteWebhookDialog.xaml.cs | 2 +- .../View/Dialog/GachaLogImportDialog.xaml | 2 +- .../View/Dialog/GachaLogImportDialog.xaml.cs | 2 +- .../Dialog/GachaLogRefreshProgressDialog.xaml | 2 +- .../GachaLogRefreshProgressDialog.xaml.cs | 2 +- .../Xaml}/View/Dialog/GachaLogUrlDialog.xaml | 2 +- .../View/Dialog/GachaLogUrlDialog.xaml.cs | 2 +- .../View/Dialog/GeetestCustomUrlDialog.xaml | 2 +- .../Dialog/GeetestCustomUrlDialog.xaml.cs | 2 +- .../View/Dialog/HutaoPassportLoginDialog.xaml | 2 +- .../Dialog/HutaoPassportLoginDialog.xaml.cs | 2 +- .../Dialog/HutaoPassportRegisterDialog.xaml | 2 +- .../HutaoPassportRegisterDialog.xaml.cs | 2 +- .../HutaoPassportResetPasswordDialog.xaml | 2 +- .../HutaoPassportResetPasswordDialog.xaml.cs | 2 +- .../Dialog/HutaoPassportUnregisterDialog.xaml | 2 +- .../HutaoPassportUnregisterDialog.xaml.cs | 2 +- .../Dialog/LaunchGameAccountNameDialog.xaml | 2 +- .../LaunchGameAccountNameDialog.xaml.cs | 2 +- .../LaunchGameConfigurationFixDialog.xaml | 6 +- .../LaunchGameConfigurationFixDialog.xaml.cs | 2 +- .../LaunchGamePackageConvertDialog.xaml | 6 +- .../LaunchGamePackageConvertDialog.xaml.cs | 2 +- .../Xaml}/View/Dialog/ReconfirmDialog.xaml | 2 +- .../Xaml}/View/Dialog/ReconfirmDialog.xaml.cs | 2 +- ...alAbyssUploadRecordHomaNotLoginDialog.xaml | 2 +- ...byssUploadRecordHomaNotLoginDialog.xaml.cs | 2 +- .../UpdatePackageDownloadConfirmDialog.xaml | 2 +- ...UpdatePackageDownloadConfirmDialog.xaml.cs | 2 +- .../{ => UI/Xaml}/View/Dialog/UserDialog.xaml | 2 +- .../Xaml}/View/Dialog/UserDialog.xaml.cs | 2 +- .../Xaml}/View/Dialog/UserQRCodeDialog.xaml | 2 +- .../View/Dialog/UserQRCodeDialog.xaml.cs | 2 +- .../Guide => UI/Xaml/View}/GuideView.xaml | 2 +- .../Guide => UI/Xaml/View}/GuideView.xaml.cs | 2 +- .../{ => UI/Xaml}/View/InfoBarView.xaml | 9 +- .../{ => UI/Xaml}/View/InfoBarView.xaml.cs | 2 +- .../{ => UI/Xaml}/View/MainView.xaml | 35 ++-- .../{ => UI/Xaml}/View/MainView.xaml.cs | 4 +- .../Xaml}/View/Page/AchievementPage.xaml | 2 +- .../Xaml}/View/Page/AchievementPage.xaml.cs | 2 +- .../Xaml}/View/Page/AnnouncementPage.xaml | 10 +- .../Xaml}/View/Page/AnnouncementPage.xaml.cs | 2 +- .../Xaml}/View/Page/AvatarPropertyPage.xaml | 2 +- .../View/Page/AvatarPropertyPage.xaml.cs | 2 +- .../Xaml}/View/Page/CultivationPage.xaml | 2 +- .../Xaml}/View/Page/CultivationPage.xaml.cs | 2 +- .../Xaml}/View/Page/DailyNotePage.xaml | 2 +- .../Xaml}/View/Page/DailyNotePage.xaml.cs | 2 +- .../{ => UI/Xaml}/View/Page/FeedbackPage.xaml | 2 +- .../Xaml}/View/Page/FeedbackPage.xaml.cs | 2 +- .../{ => UI/Xaml}/View/Page/GachaLogPage.xaml | 2 +- .../Xaml}/View/Page/GachaLogPage.xaml.cs | 2 +- .../Xaml}/View/Page/ISupportLoginByWebView.cs | 2 +- .../Xaml}/View/Page/LaunchGamePage.xaml | 2 +- .../Xaml}/View/Page/LaunchGamePage.xaml.cs | 2 +- .../View/Page/LoginHoyoverseUserPage.xaml | 2 +- .../View/Page/LoginHoyoverseUserPage.xaml.cs | 3 +- .../Xaml}/View/Page/LoginMihoyoUserPage.xaml | 2 +- .../View/Page/LoginMihoyoUserPage.xaml.cs | 3 +- .../{ => UI/Xaml}/View/Page/SettingPage.xaml | 2 +- .../Xaml}/View/Page/SettingPage.xaml.cs | 2 +- .../View/Page/SpiralAbyssRecordPage.xaml | 2 +- .../View/Page/SpiralAbyssRecordPage.xaml.cs | 2 +- .../{ => UI/Xaml}/View/Page/TestPage.xaml | 2 +- .../{ => UI/Xaml}/View/Page/TestPage.xaml.cs | 2 +- .../Xaml}/View/Page/WikiAvatarPage.xaml | 6 +- .../Xaml}/View/Page/WikiAvatarPage.xaml.cs | 2 +- .../Xaml}/View/Page/WikiMonsterPage.xaml | 2 +- .../Xaml}/View/Page/WikiMonsterPage.xaml.cs | 2 +- .../Xaml}/View/Page/WikiWeaponPage.xaml | 2 +- .../Xaml}/View/Page/WikiWeaponPage.xaml.cs | 2 +- .../{ => UI/Xaml}/View/TitleView.xaml | 2 +- .../{ => UI/Xaml}/View/TitleView.xaml.cs | 2 +- .../{ => UI/Xaml}/View/UserView.xaml | 2 +- .../{ => UI/Xaml}/View/UserView.xaml.cs | 2 +- .../AnnouncementWebView2ContentProvider.cs} | 103 ++++------ .../Xaml/View/Window}/GuideWindow.xaml | 6 +- .../Xaml/View/Window}/GuideWindow.xaml.cs | 4 +- .../View/Window/IWebView2ContentProvider.cs | 18 ++ .../View/Window}/IdentifyMonitorWindow.xaml | 2 +- .../Window}/IdentifyMonitorWindow.xaml.cs | 4 +- .../Xaml/View/Window}/LaunchGameWindow.xaml | 2 +- .../View/Window}/LaunchGameWindow.xaml.cs | 4 +- .../{ => UI/Xaml/View/Window}/MainWindow.xaml | 8 +- .../Xaml/View/Window}/MainWindow.xaml.cs | 4 +- .../UI/Xaml/View/Window/WebView2Window.xaml | 13 ++ .../Xaml/View/Window/WebView2Window.xaml.cs | 50 +++++ .../Control/AnnouncementContentViewer.xaml | 18 -- .../ViewModel/Abstraction/IViewModel.cs | 2 +- .../ViewModel/Abstraction/ViewModel.cs | 2 +- .../Achievement/AchievementImporter.cs | 2 +- .../Achievement/AchievementViewModel.cs | 2 +- .../Achievement/AchievementViewModelSlim.cs | 3 +- .../AvatarProperty/AvatarPropertyViewModel.cs | 2 +- .../Cultivation/CultivationViewModel.cs | 2 +- .../ViewModel/DailyNote/DailyNoteViewModel.cs | 2 +- .../DailyNote/DailyNoteViewModelSlim.cs | 3 +- .../ViewModel/GachaLog/GachaLogViewModel.cs | 2 +- .../GachaLog/GachaLogViewModelSlim.cs | 3 +- .../ViewModel/GachaLog/HutaoCloudViewModel.cs | 3 +- .../ViewModel/Game/LaunchGameShared.cs | 4 +- .../ViewModel/Game/LaunchGameViewModel.cs | 1 + .../ViewModel/Game/LaunchGameViewModelSlim.cs | 3 +- .../ViewModel/Home/AnnouncementViewModel.cs | 2 +- .../ViewModel/NotifyIconViewModel.cs | 1 + .../Setting/HutaoPassportViewModel.cs | 2 +- .../ViewModel/Setting/SettingViewModel.cs | 5 +- .../SpiralAbyss/SpiralAbyssRecordViewModel.cs | 4 +- .../Snap.Hutao/ViewModel/TestViewModel.cs | 1 + .../Snap.Hutao/ViewModel/TitleViewModel.cs | 2 +- .../ViewModel/User/UserViewModel.cs | 4 +- .../ViewModel/Wiki/WikiAvatarViewModel.cs | 2 +- .../ViewModel/Wiki/WikiWeaponViewModel.cs | 2 +- 152 files changed, 402 insertions(+), 454 deletions(-) create mode 100644 src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandEnvironmentView.cs rename src/Snap.Hutao/Snap.Hutao/{View/Helper/NavHelper.cs => UI/Xaml/Control/NavigationViewItemHelper.cs} (70%) rename src/Snap.Hutao/Snap.Hutao/{View/Helper => UI/Xaml}/DeferContentLoader.cs (63%) rename src/Snap.Hutao/Snap.Hutao/{View/Helper => UI/Xaml}/IDeferContentLoader.cs (87%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/AchievementCard.xaml (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/AchievementCard.xaml.cs (65%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/DailyNoteCard.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/DailyNoteCard.xaml.cs (88%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/GachaStatisticsCard.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/GachaStatisticsCard.xaml.cs (89%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/LaunchGameCard.xaml (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Card/LaunchGameCard.xaml.cs (88%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/AchievementArchiveCreateDialog.xaml (93%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/AchievementArchiveCreateDialog.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/AchievementImportDialog.xaml (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/AchievementImportDialog.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/CultivateProjectDialog.xaml (94%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/CultivateProjectDialog.xaml.cs (97%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/CultivatePromotionDeltaBatchDialog.xaml (94%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/CultivatePromotionDeltaBatchDialog.xaml.cs (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/CultivatePromotionDeltaDialog.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/CultivatePromotionDeltaDialog.xaml.cs (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/DailyNoteNotificationDialog.xaml (97%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/DailyNoteNotificationDialog.xaml.cs (94%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/DailyNoteWebhookDialog.xaml (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/DailyNoteWebhookDialog.xaml.cs (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GachaLogImportDialog.xaml (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GachaLogImportDialog.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GachaLogRefreshProgressDialog.xaml (94%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GachaLogRefreshProgressDialog.xaml.cs (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GachaLogUrlDialog.xaml (93%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GachaLogUrlDialog.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GeetestCustomUrlDialog.xaml (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/GeetestCustomUrlDialog.xaml.cs (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportLoginDialog.xaml (94%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportLoginDialog.xaml.cs (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportRegisterDialog.xaml (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportRegisterDialog.xaml.cs (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportResetPasswordDialog.xaml (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportResetPasswordDialog.xaml.cs (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportUnregisterDialog.xaml (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/HutaoPassportUnregisterDialog.xaml.cs (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/LaunchGameAccountNameDialog.xaml (93%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/LaunchGameAccountNameDialog.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/LaunchGameConfigurationFixDialog.xaml (84%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/LaunchGameConfigurationFixDialog.xaml.cs (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/LaunchGamePackageConvertDialog.xaml (87%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/LaunchGamePackageConvertDialog.xaml.cs (94%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/ReconfirmDialog.xaml (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/ReconfirmDialog.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/SpiralAbyssUploadRecordHomaNotLoginDialog.xaml (91%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/SpiralAbyssUploadRecordHomaNotLoginDialog.xaml.cs (89%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/UpdatePackageDownloadConfirmDialog.xaml (93%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/UpdatePackageDownloadConfirmDialog.xaml.cs (87%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/UserDialog.xaml (97%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/UserDialog.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/UserQRCodeDialog.xaml (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Dialog/UserQRCodeDialog.xaml.cs (99%) rename src/Snap.Hutao/Snap.Hutao/{View/Guide => UI/Xaml/View}/GuideView.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{View/Guide => UI/Xaml/View}/GuideView.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/InfoBarView.xaml (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/InfoBarView.xaml.cs (97%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/MainView.xaml (81%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/MainView.xaml.cs (96%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/AchievementPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/AchievementPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/AnnouncementPage.xaml (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/AnnouncementPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/AvatarPropertyPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/AvatarPropertyPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/CultivationPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/CultivationPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/DailyNotePage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/DailyNotePage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/FeedbackPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/FeedbackPage.xaml.cs (89%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/GachaLogPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/GachaLogPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/ISupportLoginByWebView.cs (97%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/LaunchGamePage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/LaunchGamePage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/LoginHoyoverseUserPage.xaml (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/LoginHoyoverseUserPage.xaml.cs (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/LoginMihoyoUserPage.xaml (95%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/LoginMihoyoUserPage.xaml.cs (97%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/SettingPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/SettingPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/SpiralAbyssRecordPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/SpiralAbyssRecordPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/TestPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/TestPage.xaml.cs (91%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/WikiAvatarPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/WikiAvatarPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/WikiMonsterPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/WikiMonsterPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/WikiWeaponPage.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/Page/WikiWeaponPage.xaml.cs (92%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/TitleView.xaml (98%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/TitleView.xaml.cs (93%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/UserView.xaml (99%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml}/View/UserView.xaml.cs (93%) rename src/Snap.Hutao/Snap.Hutao/{View/Control/AnnouncementContentViewer.xaml.cs => UI/Xaml/View/Window/AnnouncementWebView2ContentProvider.cs} (68%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/GuideWindow.xaml (87%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/GuideWindow.xaml.cs (93%) create mode 100644 src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/IWebView2ContentProvider.cs rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/IdentifyMonitorWindow.xaml (91%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/IdentifyMonitorWindow.xaml.cs (93%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/LaunchGameWindow.xaml (97%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/LaunchGameWindow.xaml.cs (94%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/MainWindow.xaml (73%) rename src/Snap.Hutao/Snap.Hutao/{ => UI/Xaml/View/Window}/MainWindow.xaml.cs (92%) create mode 100644 src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2Window.xaml create mode 100644 src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2Window.xaml.cs delete mode 100644 src/Snap.Hutao/Snap.Hutao/View/Control/AnnouncementContentViewer.xaml diff --git a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs index 3a2acf8c..fd0bed4d 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/LifeCycle/AppActivation.cs @@ -16,6 +16,8 @@ using Snap.Hutao.Service.Navigation; using Snap.Hutao.UI.Input.HotKey; using Snap.Hutao.UI.Shell; using Snap.Hutao.UI.Xaml; +using Snap.Hutao.UI.Xaml.View.Page; +using Snap.Hutao.UI.Xaml.View.Window; using Snap.Hutao.ViewModel.Guide; using System.Diagnostics; @@ -164,7 +166,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi case MainWindow: await serviceProvider .GetRequiredService() - .NavigateAsync(INavigationAwaiter.Default, true) + .NavigateAsync(INavigationAwaiter.Default, true) .ConfigureAwait(false); return; @@ -210,7 +212,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi // ViewModel requires the Metadata Service to be initialized. serviceProvider .GetRequiredService() - .Navigate(navigationAwaiter, true); + .Navigate(navigationAwaiter, true); #pragma warning restore CA1849 break; } diff --git a/src/Snap.Hutao/Snap.Hutao/Program.cs b/src/Snap.Hutao/Snap.Hutao/Program.cs index 0ff38f16..6d50f637 100644 --- a/src/Snap.Hutao/Snap.Hutao/Program.cs +++ b/src/Snap.Hutao/Snap.Hutao/Program.cs @@ -42,6 +42,8 @@ public static partial class Program [STAThread] private static void Main(string[] args) { + // WebView2 + Environment.SetEnvironmentVariable("WEBVIEW2_DEFAULT_BACKGROUND_COLOR", "00000000"); System.Diagnostics.Debug.WriteLine($"[Arguments]:[{args.ToString(',')}]"); XamlCheckProcessRequirements(); diff --git a/src/Snap.Hutao/Snap.Hutao/Service/GachaLog/QueryProvider/GachaLogQueryManualInputProvider.cs b/src/Snap.Hutao/Snap.Hutao/Service/GachaLog/QueryProvider/GachaLogQueryManualInputProvider.cs index cd1799ac..73f2b9b2 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/GachaLog/QueryProvider/GachaLogQueryManualInputProvider.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/GachaLog/QueryProvider/GachaLogQueryManualInputProvider.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. using Snap.Hutao.Factory.ContentDialog; -using Snap.Hutao.View.Dialog; +using Snap.Hutao.UI.Xaml.View.Dialog; using System.Collections.Specialized; using System.Web; diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/Account/GameAccountService.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/Account/GameAccountService.cs index 0d2d3e8e..146c25bf 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Game/Account/GameAccountService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/Account/GameAccountService.cs @@ -6,7 +6,7 @@ using Snap.Hutao.Core.ExceptionService; using Snap.Hutao.Factory.ContentDialog; using Snap.Hutao.Model.Entity; using Snap.Hutao.Model.Entity.Primitive; -using Snap.Hutao.View.Dialog; +using Snap.Hutao.UI.Xaml.View.Dialog; using System.Collections.ObjectModel; namespace Snap.Hutao.Service.Game.Account; diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionEnsureGameResourceHandler.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionEnsureGameResourceHandler.cs index 127327f3..d29cd85e 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionEnsureGameResourceHandler.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/Launching/Handler/LaunchExecutionEnsureGameResourceHandler.cs @@ -9,7 +9,7 @@ using Snap.Hutao.Model.Intrinsic; using Snap.Hutao.Service.Game.Configuration; using Snap.Hutao.Service.Game.Package; using Snap.Hutao.UI.Xaml.Control; -using Snap.Hutao.View.Dialog; +using Snap.Hutao.UI.Xaml.View.Dialog; using Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect; using Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.ChannelSDK; using Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.DeprecatedFile; diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandEnvironmentView.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandEnvironmentView.cs new file mode 100644 index 00000000..cb988734 --- /dev/null +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandEnvironmentView.cs @@ -0,0 +1,15 @@ +// Copyright (c) DGP Studio. All rights reserved. +// Licensed under the MIT license. + +using Snap.Hutao.Win32.Foundation; + +namespace Snap.Hutao.Service.Game.Unlocker.Island; + +internal struct IslandEnvironmentView +{ + public nuint Address; + public int Value; + public IslandState State; + public WIN32_ERROR LastError; + public int Reserved; +} \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandGameFpsUnlocker.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandGameFpsUnlocker.cs index 8796a2b6..718229bf 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandGameFpsUnlocker.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/Island/IslandGameFpsUnlocker.cs @@ -40,8 +40,8 @@ internal sealed class IslandGameFpsUnlocker : GameFpsUnlocker context.Logger.LogInformation("context.GameProcess.HasExited: {Value}", context.GameProcess.HasExited); if (!context.GameProcess.HasExited && context.FpsAddress != 0U) { - IslandState state = UpdateIslandEnvironment(handle, context, launchOptions); - context.Logger.LogDebug("Island Environment State: {State}", state); + IslandEnvironmentView view = UpdateIslandEnvironment(handle, context, launchOptions); + context.Logger.LogDebug("Island Environment|{State}|{Error}", view.State, view.LastError); context.Report(); } else @@ -91,12 +91,12 @@ internal sealed class IslandGameFpsUnlocker : GameFpsUnlocker } } - private unsafe IslandState UpdateIslandEnvironment(nint handle, GameFpsUnlockerContext context, LaunchOptions launchOptions) + private unsafe IslandEnvironmentView UpdateIslandEnvironment(nint handle, GameFpsUnlockerContext context, LaunchOptions launchOptions) { IslandEnvironment* pIslandEnvironment = (IslandEnvironment*)handle; pIslandEnvironment->Address = context.FpsAddress; pIslandEnvironment->Value = launchOptions.TargetFps; - return pIslandEnvironment->State; + return *(IslandEnvironmentView*)&pIslandEnvironment; } } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs index eb9ce7ee..3014ce6f 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Navigation/NavigationService.cs @@ -6,8 +6,7 @@ using Snap.Hutao.Core.Logging; using Snap.Hutao.Core.Setting; using Snap.Hutao.Service.Notification; using Snap.Hutao.UI.Xaml.Control; -using Snap.Hutao.View.Helper; -using Snap.Hutao.View.Page; +using Snap.Hutao.UI.Xaml.View.Page; using Windows.Foundation; namespace Snap.Hutao.Service.Navigation; @@ -200,7 +199,7 @@ internal sealed class NavigationService : INavigationService, INavigationInitial else { NavigationViewItem? target = EnumerateMenuItems(NavigationView.MenuItems) - .SingleOrDefault(menuItem => NavHelper.GetNavigateTo(menuItem) == pageType); + .SingleOrDefault(menuItem => NavigationViewItemHelper.GetNavigateTo(menuItem) == pageType); NavigationView.SelectedItem = target; } @@ -214,12 +213,12 @@ internal sealed class NavigationService : INavigationService, INavigationInitial selected = NavigationView?.SelectedItem as NavigationViewItem; Type? targetType = args.IsSettingsInvoked ? typeof(SettingPage) - : NavHelper.GetNavigateTo(selected); + : NavigationViewItemHelper.GetNavigateTo(selected); // ignore item that doesn't have nav type specified if (targetType is not null) { - INavigationAwaiter navigationAwaiter = new NavigationExtra(NavHelper.GetExtraData(selected)); + INavigationAwaiter navigationAwaiter = new NavigationExtra(NavigationViewItemHelper.GetExtraData(selected)); Navigate(targetType, navigationAwaiter, false); } } diff --git a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj index 176210e5..793c48b2 100644 --- a/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj +++ b/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj @@ -145,6 +145,7 @@ + @@ -165,29 +166,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -386,66 +387,11 @@ MSBuild:Compile - - - MSBuild:Compile - - - - - MSBuild:Compile - - - - - MSBuild:Compile - - MSBuild:Compile - - - MSBuild:Compile - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - - - - - MSBuild:Compile - - @@ -465,24 +411,12 @@ - - - MSBuild:Compile - - - MSBuild:Compile - - - MSBuild:Compile - - - MSBuild:Compile @@ -544,11 +478,6 @@ - - - MSBuild:Compile - - MSBuild:Compile @@ -564,16 +493,6 @@ MSBuild:Compile - - - MSBuild:Compile - - - - - MSBuild:Compile - - MSBuild:Compile @@ -584,11 +503,6 @@ MSBuild:Compile - - - MSBuild:Compile - - MSBuild:Compile @@ -599,11 +513,6 @@ MSBuild:Compile - - - MSBuild:Compile - - MSBuild:Compile @@ -619,26 +528,11 @@ MSBuild:Compile - - - MSBuild:Compile - - MSBuild:Compile - - - MSBuild:Compile - - - - - MSBuild:Compile - - MSBuild:Compile @@ -699,31 +593,16 @@ MSBuild:Compile - - - MSBuild:Compile - - MSBuild:Compile - - - MSBuild:Compile - - MSBuild:Compile - - - MSBuild:Compile - - MSBuild:Compile @@ -764,11 +643,6 @@ MSBuild:Compile - - - - - MSBuild:Compile @@ -779,4 +653,13 @@ MSBuild:Compile + + + + + + + MSBuild:Compile + + diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Card/CardBlock.xaml b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Card/CardBlock.xaml index c4ea2e93..fe522df2 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Card/CardBlock.xaml +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Card/CardBlock.xaml @@ -1,6 +1,7 @@ @@ -12,7 +13,7 @@ - + + Visibility="{Binding (cw:FrameworkElementExtensions.Ancestor).IsDotVisible, RelativeSource={RelativeSource Self}, Converter={StaticResource BoolToVisibilityConverter}}"/> diff --git a/src/Snap.Hutao/Snap.Hutao/View/Helper/NavHelper.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/NavigationViewItemHelper.cs similarity index 70% rename from src/Snap.Hutao/Snap.Hutao/View/Helper/NavHelper.cs rename to src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/NavigationViewItemHelper.cs index 39a6e52f..f3b2f23c 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Helper/NavHelper.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/NavigationViewItemHelper.cs @@ -4,16 +4,11 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; -namespace Snap.Hutao.View.Helper; +namespace Snap.Hutao.UI.Xaml.Control; -/// -/// 导航项帮助类 -/// This type can't be internal -/// -[HighQuality] [SuppressMessage("", "SH001")] [DependencyProperty("NavigateTo", typeof(Type), IsAttached = true, AttachedType = typeof(NavigationViewItem))] [DependencyProperty("ExtraData", typeof(object), IsAttached = true, AttachedType = typeof(NavigationViewItem))] -public sealed partial class NavHelper +public sealed partial class NavigationViewItemHelper { } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ScopedPage.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ScopedPage.cs index 7c655c53..88659ac4 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ScopedPage.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ScopedPage.cs @@ -6,7 +6,6 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Markup; using Microsoft.UI.Xaml.Navigation; using Snap.Hutao.Service.Navigation; -using Snap.Hutao.View.Helper; using Snap.Hutao.ViewModel.Abstraction; namespace Snap.Hutao.UI.Xaml.Control; @@ -15,7 +14,6 @@ namespace Snap.Hutao.UI.Xaml.Control; [SuppressMessage("", "CA1001")] internal class ScopedPage : Page { - private readonly RoutedEventHandler unloadEventHandler; private readonly CancellationTokenSource viewCancellationTokenSource = new(); private readonly IServiceScope pageScope; @@ -23,8 +21,7 @@ internal class ScopedPage : Page protected ScopedPage() { - unloadEventHandler = OnUnloaded; - Unloaded += unloadEventHandler; + Unloaded += OnUnloaded; pageScope = Ioc.Default.GetRequiredService().CreateScope(); } @@ -98,7 +95,7 @@ internal class ScopedPage : Page return; } - Unloaded -= unloadEventHandler; + Unloaded -= OnUnloaded; } private void DisposeViewModel() diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Theme/TransitionCollection.xaml b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Theme/TransitionCollection.xaml index fff27230..b4b87691 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Theme/TransitionCollection.xaml +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/Theme/TransitionCollection.xaml @@ -1,4 +1,7 @@  + + + @@ -11,13 +14,13 @@ + + + - - - \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Data/Converter/VisibilityToObjectConverter.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Data/Converter/VisibilityToObjectConverter.cs index 125004fd..1d38574f 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Data/Converter/VisibilityToObjectConverter.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/Data/Converter/VisibilityToObjectConverter.cs @@ -4,7 +4,7 @@ using Microsoft.UI.Xaml; using Snap.Hutao.UI.Xaml.Data.Converter; -namespace Snap.Hutao.View.Converter; +namespace Snap.Hutao.UI.Xaml.Data.Converter; [DependencyProperty("VisibleValue", typeof(object))] [DependencyProperty("CollapsedValue", typeof(object))] diff --git a/src/Snap.Hutao/Snap.Hutao/View/Helper/DeferContentLoader.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/DeferContentLoader.cs similarity index 63% rename from src/Snap.Hutao/Snap.Hutao/View/Helper/DeferContentLoader.cs rename to src/Snap.Hutao/Snap.Hutao/UI/Xaml/DeferContentLoader.cs index 5d6f86b2..8bdb87a9 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Helper/DeferContentLoader.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/DeferContentLoader.cs @@ -5,20 +5,20 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Markup; using Snap.Hutao.UI.Xaml.Control; -namespace Snap.Hutao.View.Helper; +namespace Snap.Hutao.UI.Xaml; internal sealed class DeferContentLoader : IDeferContentLoader { - private readonly WeakReference reference = new(default!); + private readonly WeakReference contentHost = new(default!); public DeferContentLoader(FrameworkElement element) { - reference.SetTarget(element); + contentHost.SetTarget(element); } public DependencyObject? Load(string name) { - if (reference.TryGetTarget(out FrameworkElement? element)) + if (contentHost.TryGetTarget(out FrameworkElement? element)) { return element.FindName(name) as DependencyObject; } @@ -28,9 +28,9 @@ internal sealed class DeferContentLoader : IDeferContentLoader public void Unload(DependencyObject @object) { - if (reference.TryGetTarget(out FrameworkElement? element) && element is ScopedPage scopedPage) + if (contentHost.TryGetTarget(out FrameworkElement? element) && element is ScopedPage scopedPage) { - scopedPage.UnloadObjectOverride(@object); + scopedPage.UnloadObjectOverride(@object); } else { diff --git a/src/Snap.Hutao/Snap.Hutao/View/Helper/IDeferContentLoader.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/IDeferContentLoader.cs similarity index 87% rename from src/Snap.Hutao/Snap.Hutao/View/Helper/IDeferContentLoader.cs rename to src/Snap.Hutao/Snap.Hutao/UI/Xaml/IDeferContentLoader.cs index 542a5452..60052c76 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Helper/IDeferContentLoader.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/IDeferContentLoader.cs @@ -3,7 +3,7 @@ using Microsoft.UI.Xaml; -namespace Snap.Hutao.View.Helper; +namespace Snap.Hutao.UI.Xaml; internal interface IDeferContentLoader { diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/UIElementHelper.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/UIElementHelper.cs index e506369c..4a5a96a9 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/UIElementHelper.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/UIElementHelper.cs @@ -7,6 +7,7 @@ namespace Snap.Hutao.UI.Xaml; [SuppressMessage("", "SH001")] [DependencyProperty("VisibilityObject", typeof(object), null, nameof(OnVisibilityObjectChanged), IsAttached = true, AttachedType = typeof(UIElement))] +[DependencyProperty("VisibilityBoolean", typeof(bool), null, nameof(OnVisibilityBooleanChanged), IsAttached = true, AttachedType = typeof(UIElement))] [DependencyProperty("OpacityObject", typeof(object), null, nameof(OnOpacityObjectChanged), IsAttached = true, AttachedType = typeof(UIElement))] public sealed partial class UIElementHelper { @@ -21,4 +22,10 @@ public sealed partial class UIElementHelper UIElement element = (UIElement)dp; element.Opacity = e.NewValue is null ? 0D : 1D; } + + private static void OnVisibilityBooleanChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e) + { + UIElement element = (UIElement)dp; + element.Visibility = e.NewValue is true ? Visibility.Visible : Visibility.Collapsed; + } } \ No newline at end of file diff --git a/src/Snap.Hutao/Snap.Hutao/View/Card/AchievementCard.xaml b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Card/AchievementCard.xaml similarity index 98% rename from src/Snap.Hutao/Snap.Hutao/View/Card/AchievementCard.xaml rename to src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Card/AchievementCard.xaml index 1fecd58e..bd2ba4d4 100644 --- a/src/Snap.Hutao/Snap.Hutao/View/Card/AchievementCard.xaml +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Card/AchievementCard.xaml @@ -1,5 +1,5 @@