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

38 lines
1.1 KiB
C#
Raw Normal View History

2025-05-25 13:27:22 +02:00
using AIStudio.Dialogs.Settings;
2024-09-09 15:08:16 +02:00
using AIStudio.Settings;
using Microsoft.AspNetCore.Components;
2025-05-25 13:27:22 +02:00
using DialogOptions = AIStudio.Dialogs.DialogOptions;
2024-09-09 15:08:16 +02:00
namespace AIStudio.Components;
2025-04-27 09:06:05 +02:00
public partial class ProfileFormSelection : MSGComponentBase
2024-09-09 15:08:16 +02:00
{
[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;
[Parameter]
public bool Disabled { get; set; }
2024-09-09 15:08:16 +02:00
2025-05-25 13:27:22 +02:00
[Inject]
public IDialogService DialogService { get; init; } = null!;
2026-10-31 10:48:20 +01:00
private async Task SelectionChanged(Profile? profile)
2024-09-09 15:08:16 +02:00
{
2026-10-31 10:48:20 +01:00
this.Profile = profile ?? Profile.NO_PROFILE;
await this.ProfileChanged.InvokeAsync(this.Profile);
2024-09-09 15:08:16 +02:00
}
2025-05-25 13:27:22 +02:00
private async Task OpenSettingsDialog()
{
var dialogParameters = new DialogParameters();
await this.DialogService.ShowAsync<SettingsDialogProfiles>(T("Open Profile Options"), dialogParameters, DialogOptions.FULLSCREEN);
}
2024-09-09 15:08:16 +02:00
}