@page "/expand" @page "/expand/{messageId}" @inherits PagesBase
esempio di messaggio precedente a quello espanso
", Medias = new(), CreatedAt = DateTime.UtcNow.AddMinutes(Random.Shared.Next(-5000, 0)), IsFavourite = Random.Shared.Next() % 2 == 0, IsBoosted = Random.Shared.Next() % 2 == 0, } }; Descendants = new Listesempio di messaggio successivo a quello espanso
", Medias = new(), CreatedAt = DateTime.UtcNow.AddMinutes(Random.Shared.Next(-5000, 0)), IsFavourite = Random.Shared.Next() % 2 == 0, IsBoosted = Random.Shared.Next() % 2 == 0, } }; IsLoading = false; } void OnTimeSortingChanged(TimeSortingType timeSortingType) { TimeSortingType = timeSortingType; } async Task OnMessageReply(MessageForm messageForm) { await Task.Run(() => { }); var replyMessage = await MessagesService.SubmitMessage(messageForm); Descendants.Add(new() { MessageId = Guid.NewGuid().ToString(), Content = messageForm.Content?.ParseContent(messageForm.ContentType), CreatedAt = DateTime.UtcNow, MessageType = messageForm.MessageType, Medias = messageForm.Media.Select(m => new Media { FileName = m.FileName, AltText = m.AltText, ContentType = m.ContentType, Url = m.Base64Preview, Blob = m.Blob }).ToList(), Title = messageForm.Title, User = new MessageUser { UserId = CascadingState.User.Id, UserName = CascadingState.User.UserName, DisplayName = CascadingState.User.DisplayName, PictureUrl = CascadingState.User.PictureUrl, ProfileUrl = CascadingState.User.ProfileUrl, BackgroundUrl = CascadingState.User.BackgroundUrl }, }); } async ValueTask OnMessageBoost(Message message) { await Task.Run(() => { }); message.IsBoosted = !message.IsBoosted; var boostedMessage = await MessagesService.BoostUnboostMessage(message); } async ValueTask OnMessageFavourite(Message message) { await Task.Run(() => { }); message.IsFavourite = !message.IsFavourite; var favouriteMessage = await MessagesService.FavouriteUnfavouriteMessage(message); } async ValueTask OnMessageDelete(Message message) { await Task.Run(() => { }); var deleteResult = await MessagesService.DeleteMessage(message); } async ValueTask OnMessageMediaDownload(Media media) { await Task.Run(() => { }); await BlazorDownloadFileService.DownloadFileAsync(media.FileName, media.Blob, media.ContentType); } async ValueTask OnUserBlock(MessageUser messageUser) { await Task.Run(() => { }); var blockResult = await MessagesService.BlockUserFromMessage(messageUser); } async ValueTask OnUserDirectMessage(Message message) { await Task.Run(() => { }); var directMessage = await MessagesService.ReplyMessage(message, MessageType.Direct); } async ValueTask OnUserSilence(MessageUser messageUser) { await Task.Run(() => { }); var silenceResult = await MessagesService.SilenceUserFromMessage(messageUser); } }