AI-Studio/app/MindWork AI Studio/Components/ProfileFormSelection.razor.cs

35 lines
1005 B
C#
Raw Normal View History

2025-05-25 11:27:22 +00:00
using AIStudio.Dialogs.Settings;
using AIStudio.Settings;
using Microsoft.AspNetCore.Components;
2025-05-25 11:27:22 +00:00
using DialogOptions = AIStudio.Dialogs.DialogOptions;
namespace AIStudio.Components;
2025-04-27 07:06:05 +00:00
public partial class ProfileFormSelection : MSGComponentBase
{
[Parameter]
public Profile Profile { get; set; } = Profile.NO_PROFILE;
[Parameter]
public EventCallback<Profile> ProfileChanged { get; set; }
[Parameter]
public Func<Profile, string?> Validation { get; set; } = _ => null;
2025-05-25 11:27:22 +00:00
[Inject]
public IDialogService DialogService { get; init; } = null!;
private async Task SelectionChanged(Profile profile)
{
this.Profile = profile;
await this.ProfileChanged.InvokeAsync(profile);
}
2025-05-25 11:27:22 +00:00
private async Task OpenSettingsDialog()
{
var dialogParameters = new DialogParameters();
await this.DialogService.ShowAsync<SettingsDialogProfiles>(T("Open Profile Options"), dialogParameters, DialogOptions.FULLSCREEN);
}
}