web UI
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user