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(); //}