@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Components.Layout
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Components.Layout.Overlay
@inject IAttachedService AttachedService
@if (CanAddPosition)
{
}
@code {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; }
[Parameter] public bool CanAddPosition { get; set; }
//Overlay for save
private bool VisibleOverlay { get; set; }
private bool SuccessAnimation { get; set; }
private AttachedDTO? Attached { get; set; }
protected override async Task OnInitializedAsync()
{
Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter;
_ = LoadData();
}
private async Task LoadData()
{
}
private async Task Save()
{
VisibleOverlay = true;
StateHasChanged();
SuccessAnimation = true;
StateHasChanged();
await Task.Delay(1250);
MudDialog.Close();
}
private async Task OnImage()
{
Attached = await AttachedService.SelectImage();
MudDialog.Close(Attached);
}
private async Task OnFile()
{
Attached = await AttachedService.SelectFile();
MudDialog.Close(Attached);
}
private async Task OnPosition()
{
Attached = await AttachedService.SelectPosition();
MudDialog.Close(Attached);
}
}