diff --git a/src/Snap.Hutao/Snap.Hutao/Control/Behavior/ComboBoxExtendsContentIntoTitleBarWorkaroundBehavior.cs b/src/Snap.Hutao/Snap.Hutao/Control/Behavior/ComboBoxExtendsContentIntoTitleBarWorkaroundBehavior.cs
deleted file mode 100644
index 2f940eb7..00000000
--- a/src/Snap.Hutao/Snap.Hutao/Control/Behavior/ComboBoxExtendsContentIntoTitleBarWorkaroundBehavior.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) DGP Studio. All rights reserved.
-// Licensed under the MIT license.
-
-using CommunityToolkit.Mvvm.Messaging;
-using CommunityToolkit.WinUI.Behaviors;
-using Microsoft.UI.Xaml.Controls;
-
-namespace Snap.Hutao.Control.Behavior;
-
-///
-/// AppTitleBar Workaround
-/// https://github.com/microsoft/microsoft-ui-xaml/issues/7756
-///
-internal sealed class ComboBoxExtendsContentIntoTitleBarWorkaroundBehavior : BehaviorBase
-{
- private readonly IMessenger messenger;
- private readonly EventHandler
+ SelectedItem="{Binding SelectedArchive, Mode=TwoWay}"/>
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+ Visibility="{Binding ShouldShowTimeDescription, Converter={StaticResource BoolToVisibilityConverter}}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
+
-
-
-
-
-
-
-
-
+ Visibility="{Binding Cards.Count, Converter={StaticResource Int32ToVisibilityConverter}}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml
index 012ee9ae..e1c644d2 100644
--- a/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml
+++ b/src/Snap.Hutao/Snap.Hutao/View/Page/CultivationPage.xaml
@@ -66,11 +66,7 @@
Margin="6,6,6,6"
DisplayMemberPath="Name"
ItemsSource="{Binding Projects}"
- SelectedItem="{Binding SelectedProject, Mode=TwoWay}">
-
-
-
-
+ SelectedItem="{Binding SelectedProject, Mode=TwoWay}"/>
-
-
-
-
+ SelectedItem="{Binding SelectedArchive, Mode=TwoWay}"/>
diff --git a/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml b/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
index c525e592..0f78a8bc 100644
--- a/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
+++ b/src/Snap.Hutao/Snap.Hutao/View/Page/SettingPage.xaml
@@ -23,9 +23,9 @@
-
+ Source="ms-appx:///Resource/BlurBackground.png"
+ Stretch="Fill"/>
+
@@ -91,6 +91,8 @@
Description="{Binding HutaoOptions.WebView2Version}"
Header="{shcm:ResourceString Name=ViewPageSettingWebview2Header}"
HeaderIcon="{shcm:FontIcon Glyph=}"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ IsClickEnabled="True">
+
+
+
+
+
+
+
+ IsClickEnabled="True">
+
+
+
+
+
+
+
? hutaoAnnouncements;
+ private List? cards;
///
/// 公告
@@ -43,8 +46,11 @@ internal sealed partial class AnnouncementViewModel : Abstraction.ViewModel
///
public string GreetingText { get => greetingText; set => SetProperty(ref greetingText, value); }
+ public List? Cards { get => cards; set => SetProperty(ref cards, value); }
+
protected override ValueTask InitializeUIAsync()
{
+ InitializeDashboard();
InitializeInGameAnnouncementAsync().SafeForget();
InitializeHutaoAnnouncementAsync().SafeForget();
UpdateGreetingText();
@@ -105,4 +111,31 @@ internal sealed partial class AnnouncementViewModel : Abstraction.ViewModel
}
}
}
+
+ private void InitializeDashboard()
+ {
+ List result = new();
+
+ if (LocalSetting.Get(SettingKeys.IsHomeCardLaunchGamePresented, true))
+ {
+ result.Add(new() { Card = new LaunchGameCard() });
+ }
+
+ if (LocalSetting.Get(SettingKeys.IsHomeCardGachaStatisticsPresented, true))
+ {
+ result.Add(new() { Card = new GachaStatisticsCard() });
+ }
+
+ if (LocalSetting.Get(SettingKeys.IsHomeCardAchievementPresented, true))
+ {
+ result.Add(new() { Card = new AchievementCard() });
+ }
+
+ if (LocalSetting.Get(SettingKeys.IsHomeCardDailyNotePresented, true))
+ {
+ result.Add(new() { Card = new DailyNoteCard() });
+ }
+
+ Cards = result;
+ }
}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/ViewModel/HomeCardOptions.cs b/src/Snap.Hutao/Snap.Hutao/ViewModel/HomeCardOptions.cs
new file mode 100644
index 00000000..4aa00d26
--- /dev/null
+++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/HomeCardOptions.cs
@@ -0,0 +1,33 @@
+// Copyright (c) DGP Studio. All rights reserved.
+// Licensed under the MIT license.
+
+using Snap.Hutao.Core.Setting;
+
+namespace Snap.Hutao.ViewModel;
+
+internal sealed class HomeCardOptions
+{
+ public bool IsHomeCardLaunchGamePresented
+ {
+ get => LocalSetting.Get(SettingKeys.IsHomeCardLaunchGamePresented, true);
+ set => LocalSetting.Set(SettingKeys.IsHomeCardLaunchGamePresented, value);
+ }
+
+ public bool IsHomeCardGachaStatisticsPresented
+ {
+ get => LocalSetting.Get(SettingKeys.IsHomeCardGachaStatisticsPresented, true);
+ set => LocalSetting.Set(SettingKeys.IsHomeCardGachaStatisticsPresented, value);
+ }
+
+ public bool IsHomeCardAchievementPresented
+ {
+ get => LocalSetting.Get(SettingKeys.IsHomeCardAchievementPresented, true);
+ set => LocalSetting.Set(SettingKeys.IsHomeCardAchievementPresented, value);
+ }
+
+ public bool IsHomeCardDailyNotePresented
+ {
+ get => LocalSetting.Get(SettingKeys.IsHomeCardDailyNotePresented, true);
+ set => LocalSetting.Set(SettingKeys.IsHomeCardDailyNotePresented, value);
+ }
+}
\ No newline at end of file
diff --git a/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs b/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
index 896123c8..e507753a 100644
--- a/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
+++ b/src/Snap.Hutao/Snap.Hutao/ViewModel/SettingViewModel.cs
@@ -37,6 +37,8 @@ namespace Snap.Hutao.ViewModel;
[Injection(InjectAs.Scoped)]
internal sealed partial class SettingViewModel : Abstraction.ViewModel
{
+ private readonly HomeCardOptions homeCardOptions = new();
+
private readonly IContentDialogFactory contentDialogFactory;
private readonly IGameLocatorFactory gameLocatorFactory;
private readonly INavigationService navigationService;
@@ -68,6 +70,8 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
///
public HutaoUserOptions UserOptions { get => hutaoUserOptions; }
+ public HomeCardOptions HomeCardOptions { get => homeCardOptions; }
+
///
/// 选中的背景类型
///