Update On Fri Aug 23 20:31:50 CEST 2024

This commit is contained in:
github-action[bot]
2024-08-23 20:31:50 +02:00
parent 8d1576d1b7
commit 1c8560324f
57 changed files with 589 additions and 339 deletions
@@ -23,7 +23,7 @@ namespace ServiceLib.ViewModels
public ReactiveCommand<Unit, Unit> SubShareCmd { get; }
public bool IsModified { get; set; }
public SubSettingViewModel(Func<EViewAction, object?, bool>? updateView)
public SubSettingViewModel(Func<EViewAction, object?, Task<bool>>? updateView)
{
_config = LazyConfig.Instance.Config;
_noticeHandler = Locator.Current.GetService<NoticeHandler>();
@@ -39,19 +39,19 @@ namespace ServiceLib.ViewModels
SubAddCmd = ReactiveCommand.Create(() =>
{
EditSub(true);
EditSubAsync(true);
});
SubDeleteCmd = ReactiveCommand.Create(() =>
{
DeleteSub();
DeleteSubAsync();
}, canEditRemove);
SubEditCmd = ReactiveCommand.Create(() =>
SubEditCmd = ReactiveCommand.CreateFromTask(async () =>
{
EditSub(false);
await EditSubAsync(false);
}, canEditRemove);
SubShareCmd = ReactiveCommand.Create(() =>
SubShareCmd = ReactiveCommand.CreateFromTask(async () =>
{
_updateView?.Invoke(EViewAction.ShareSub, SelectedSource?.url);
await _updateView?.Invoke(EViewAction.ShareSub, SelectedSource?.url);
}, canEditRemove);
}
@@ -61,7 +61,7 @@ namespace ServiceLib.ViewModels
_subItems.AddRange(LazyConfig.Instance.SubItems().OrderBy(t => t.sort));
}
public void EditSub(bool blNew)
public async Task EditSubAsync(bool blNew)
{
SubItem item;
if (blNew)
@@ -76,16 +76,16 @@ namespace ServiceLib.ViewModels
return;
}
}
if (_updateView?.Invoke(EViewAction.SubEditWindow, item) == true)
if (await _updateView?.Invoke(EViewAction.SubEditWindow, item) == true)
{
RefreshSubItems();
IsModified = true;
}
}
private void DeleteSub()
private async Task DeleteSubAsync()
{
if (_updateView?.Invoke(EViewAction.ShowYesNo, null) == false)
if (await _updateView?.Invoke(EViewAction.ShowYesNo, null) == false)
{
return;
}