Adjustment of server binding

This commit is contained in:
2dust
2024-08-27 13:18:18 +08:00
parent 43753b1b7a
commit d3c0f50fec
4 changed files with 10 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ namespace ServiceLib.ViewModels
{
[Reactive]
public ProfileItem SelectedSource { get; set; }
[Reactive]
public string? CoreType { get; set; }
public ReactiveCommand<Unit, Unit> SaveCmd { get; }
@@ -30,6 +32,7 @@ namespace ServiceLib.ViewModels
{
SelectedSource = JsonUtils.DeepCopy(profileItem);
}
CoreType = SelectedSource?.coreType?.ToString();
SaveCmd = ReactiveCommand.Create(() =>
{
@@ -79,6 +82,7 @@ namespace ServiceLib.ViewModels
return;
}
}
SelectedSource.coreType = (ECoreType)Enum.Parse(typeof(ECoreType), CoreType);
if (ConfigHandler.AddServer(_config, SelectedSource) == 0)
{