mirror of
https://github.com/2dust/v2rayN.git
synced 2026-08-24 16:12:05 +03:00
Add 'New Update' notification flow
Introduce a small update-notification feature: add AppEvents.HasUpdateNotified event and have TaskManager publish it when update messages exist. Add localized resource key (menuNewUpdate) and expose it in the ResUI designer; update resource files for several languages. In the UI, add a New Update button in MainWindow.xaml, wire its click to the existing check-update handler, bind its visibility to a new BlNewUpdate property on MainWindowViewModel, and subscribe the viewmodel to the new event. Also reset the notification flag after showing the Check Update dialog.
This commit is contained in:
@@ -65,6 +65,8 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
|
||||
[Reactive] public bool BlIsWindows { get; set; }
|
||||
|
||||
[Reactive] public bool BlNewUpdate { get; set; }
|
||||
|
||||
#endregion Menu
|
||||
|
||||
#region Init
|
||||
@@ -251,6 +253,11 @@ public class MainWindowViewModel : MyReactiveObject
|
||||
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||
.Subscribe(async blProxy => await UpdateSubscriptionProcess("", blProxy));
|
||||
|
||||
AppEvents.HasUpdateNotified
|
||||
.AsObservable()
|
||||
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||
.Subscribe(async bl => BlNewUpdate = bl);
|
||||
|
||||
#endregion AppEvents
|
||||
|
||||
_ = Init();
|
||||
|
||||
Reference in New Issue
Block a user