From d34a5d3347311254739452ec5ffd0f6cb6a7c4b4 Mon Sep 17 00:00:00 2001 From: RMBGAME Date: Thu, 16 Nov 2023 14:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20=E6=94=B9=E8=BF=9B=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Views/Pages/HomePage.axaml.cs | 2 +- .../UI/Views/Windows/MainWindow.axaml.cs | 1 + .../UI/ViewModels/IdleCardPageViewModel.cs | 9 +++++++-- .../ViewModels/IdleCardPageViewModel.props.cs | 3 +++ .../UI/Views/Pages/IdleCardPage.axaml | 5 +++-- .../UI/ViewModels/Pages/HomePageViewModel.cs | 6 ++++++ .../Windows/Main/MainWindowViewModel.cs | 19 ++++++++++--------- 7 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/HomePage.axaml.cs b/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/HomePage.axaml.cs index 55f357e750b..34a17db153c 100644 --- a/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/HomePage.axaml.cs +++ b/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/HomePage.axaml.cs @@ -7,7 +7,7 @@ public partial class HomePage : ReactiveUserControl public HomePage() { InitializeComponent(); - this.SetViewModel(false); + this.SetViewModel(true); //ShopsScrollViewer.PointerWheelChanged += ShopsScrollViewer_PointerWheelChanged; } diff --git a/src/BD.WTTS.Client.Avalonia/UI/Views/Windows/MainWindow.axaml.cs b/src/BD.WTTS.Client.Avalonia/UI/Views/Windows/MainWindow.axaml.cs index 768223666fa..f5a65ea3ae7 100644 --- a/src/BD.WTTS.Client.Avalonia/UI/Views/Windows/MainWindow.axaml.cs +++ b/src/BD.WTTS.Client.Avalonia/UI/Views/Windows/MainWindow.axaml.cs @@ -52,6 +52,7 @@ protected override void OnOpened(EventArgs e) } Task2.InBackground(async () => { + IViewModelManager.Instance.Get().GetServerContent(); await AdvertiseService.Current.RefrshAdvertiseAsync(); NoticeService.Current.GetNewsAsync(); }); diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs index d15b7e84e38..36a578d3832 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.cs @@ -26,8 +26,13 @@ public IdleCardPageViewModel() this.IdleManualRunNext = ReactiveCommand.Create(ManualRunNext); this.LoginSteamCommand = ReactiveCommand.Create(async () => { - await LoginSteam(); - await SteamAppsSort(); + if (!IsLoaing) + { + IsLoaing = true; + await LoginSteam(); + await SteamAppsSort(); + IsLoaing = false; + } }); } diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs index 34d3383a730..4c488d68b4f 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/ViewModels/IdleCardPageViewModel.props.cs @@ -12,6 +12,9 @@ public sealed partial class IdleCardPageViewModel public ICommand IdleManualRunNext { get; } + [Reactive] + public bool IsLoaing { get; set; } + [Reactive] public bool RunLoaingState { get; set; } diff --git a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml index 3ebde39ce51..941cb24b1a2 100644 --- a/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml +++ b/src/BD.WTTS.Client.Plugins.SteamIdleCard/UI/Views/Pages/IdleCardPage.axaml @@ -46,7 +46,7 @@ - + - + diff --git a/src/BD.WTTS.Client/UI/ViewModels/Pages/HomePageViewModel.cs b/src/BD.WTTS.Client/UI/ViewModels/Pages/HomePageViewModel.cs index fbee9146ff1..0df47da8614 100644 --- a/src/BD.WTTS.Client/UI/ViewModels/Pages/HomePageViewModel.cs +++ b/src/BD.WTTS.Client/UI/ViewModels/Pages/HomePageViewModel.cs @@ -35,6 +35,12 @@ public HomePageViewModel() NavgationToMenuPageCommand = ReactiveCommand.Create(NavgationToMenuPage); + //GetServerContent(); + } + + public override void Activation() + { + base.Activation(); GetServerContent(); } diff --git a/src/BD.WTTS.Client/UI/ViewModels/Windows/Main/MainWindowViewModel.cs b/src/BD.WTTS.Client/UI/ViewModels/Windows/Main/MainWindowViewModel.cs index 75cc95b7678..fb49116ad86 100644 --- a/src/BD.WTTS.Client/UI/ViewModels/Windows/Main/MainWindowViewModel.cs +++ b/src/BD.WTTS.Client/UI/ViewModels/Windows/Main/MainWindowViewModel.cs @@ -187,15 +187,16 @@ public override async Task Initialize() //public async override void Activation() //{ - // if (IsFirstActivation) - // { - // if (UISettings.DoNotShowMessageBoxs.Value?.Contains(MessageBox.DontPromptType.Donate) == false) - // { - // //INotificationService.Instance.Notify("如果你觉得 Watt Toolkit 好用,你可以考虑给我们一些捐助以支持我们继续开发,谢谢!", NotificationType.Message); - // await MessageBox.ShowAsync("如果你觉得 Watt Toolkit 好用,你可以考虑给我们一些捐助以支持我们继续开发,谢谢!", button: MessageBox.Button.OK, - // rememberChooseKey: MessageBox.DontPromptType.Donate); - // } - // } + // //if (IsFirstActivation) + // //{ + // // if (UISettings.DoNotShowMessageBoxs.Value?.Contains(MessageBox.DontPromptType.Donate) == false) + // // { + // // //INotificationService.Instance.Notify("如果你觉得 Watt Toolkit 好用,你可以考虑给我们一些捐助以支持我们继续开发,谢谢!", NotificationType.Message); + // // await MessageBox.ShowAsync("如果你觉得 Watt Toolkit 好用,你可以考虑给我们一些捐助以支持我们继续开发,谢谢!", button: MessageBox.Button.OK, + // // rememberChooseKey: MessageBox.DontPromptType.Donate); + // // } + // //} + // base.Activation(); //}