This commit is contained in:
EugeneTes
2026-03-19 09:03:37 +01:00
parent 14fe822962
commit 83597b8763
55 changed files with 2136 additions and 32 deletions

View File

@@ -14,12 +14,13 @@ public class WindowsImagePreviewService: IImagePreviewService
}
public ImagePreview? CurrentWindow { get; private set; }
public void ShowImagePreview(ErrorPreviewVM errorPreviewVm)
public Task ShowImagePreviewAsync(ErrorPreviewVM errorPreviewVm)
{
var window = new ImagePreview();
window.SetViewModel(errorPreviewVm);
CurrentWindow = window;
window.ShowDialog();
CurrentWindow = null;
return Task.CompletedTask;
}
}

View File

@@ -5,15 +5,15 @@ namespace VisionBuilder.UI.Windows.Settings;
public class WindowsPasswordInputService: IPasswordInputService
{
public string GetPassword()
public Task<string?> GetPasswordAsync()
{
if (MaterialInputBox.Prompt("Password required", "", out var password, true) == DialogResult.OK)
{
return password;
return Task.FromResult<string?>(password);
}
else
{
return null;
return Task.FromResult<string?>(null);
}
}
}

View File

@@ -13,13 +13,9 @@ public class WindowsRecipeSelectionDialogService: IRecipeSelectionDialogService
_recipeCreationTool = recipeCreationTool;
}
public bool SelectRecipe(RecipeSelectionVM recipeSelectionVm)
public Task<bool> SelectRecipeAsync(RecipeSelectionVM recipeSelectionVm)
{
RecipeSelectionDialog dialog = new RecipeSelectionDialog(recipeSelectionVm, _recipeCreationTool);
if(dialog.ShowDialog() == DialogResult.OK)
{
return true;
}
return false;
return Task.FromResult(dialog.ShowDialog() == DialogResult.OK);
}
}

View File

@@ -17,7 +17,7 @@ public class WindowsSettingsService: ISettingsService
}
public void ShowSettingsDialog()
public Task ShowSettingsDialogAsync()
{
Thread th = new Thread(() =>
{
@@ -30,5 +30,6 @@ public class WindowsSettingsService: ISettingsService
});
th.SetApartmentState(ApartmentState.STA);
th.Start();
return Task.CompletedTask;
}
}