@using SteUp.Shared.Components.Layout @using SteUp.Shared.Components.Layout.Overlay @if (RequireNewName) { } else {
}
@if (RequireNewName) { Salva }
@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; } private bool _requireNewName; private bool RequireNewName { get => _requireNewName; set { _requireNewName = value; TitleModal = _requireNewName ? "Nome allegato" : "Aggiungi allegati"; StateHasChanged(); } } private bool SelectTypePicture { get; set; } private string TitleModal { get; set; } = "Aggiungi allegati"; private string? _newName; private string? NewName { get => _newName; set { _newName = value; StateHasChanged(); } } protected override async Task OnInitializedAsync() { SelectTypePicture = true; RequireNewName = false; Snackbar.Configuration.PositionClass = Defaults.Classes.Position.TopCenter; } private async Task OnCamera() { // Attached = await AttachedService.SelectImageFromCamera(); // // if (Attached != null) // { // RequireNewName = true; // StateHasChanged(); // } } private async Task OnGallery() { // Attached = await AttachedService.SelectImageFromGallery(); // // if (Attached != null) // { // RequireNewName = true; // StateHasChanged(); // } } private void OnNewName() { // if (Attached != null) // { // switch (Attached.Type) // { // case AttachedDTO.TypeAttached.Position: // { // CanAddPosition = false; // // Attached.Description = NewName!; // Attached.Name = NewName!; // // break; // } // case AttachedDTO.TypeAttached.Image: // { // var extension = Path.GetExtension(Attached.Name); // Attached.Name = NewName! + extension; // // break; // } // case AttachedDTO.TypeAttached.Document: // break; // default: // throw new ArgumentOutOfRangeException(); // } // } // MudDialog.Close(Attached); MudDialog.Close(); } }