Repository navigation
.WithStyle("height: auto") #50
|
I am trying to replace the existing MudDialog with your dialog so I can Drag the window around. We have some razor components that are displayed in the dialog that can have their height change based on user interaction. I can't figure out how to get the height of the dialog to be set to auto so the dialog will resize based on the content height. Also, when the height changes, the dialog should recenter itself. trying this: options.DialogAppearance = MudExAppearance.FromStyle(s => s |
Replies: 1 comment
|
First sorry for late answering, I was not availble last week. However your code is in general correct, but problem is the original MudBlazor dialog handling overwrites your size. What you can do to solve this is create a css class with height auto as important for the dialog and asign them like you do with If you need to do it in c# you can do it like this for example // Build Temporary Class
var cls = await MudExStyleBuilder.Default.WithHeight("auto").AsImportant().BuildAsClassRuleAsync("my-class", jsRuntime);
var parameters = new DialogParameters
{
{ nameof(MudExMessageDialog.Buttons), MudExDialogResultAction.OkCancel("Upload") },
{ nameof(MudExMessageDialog.Icon), Icons.Material.Filled.FileUpload }
};
var res =await dialogService.ShowComponentInDialogAsync<MudExUploadEdit<UploadableFile>>("Upload content", "Upload content files as zip or separate",
uploadEdit =>
{
uploadEdit.MinHeight = 400;
uploadEdit.AutoExtractArchive = true;
uploadEdit.MimeTypes = mimeTypes;
}, parameters, options =>
{
options.Resizeable = true;
options.FullWidth = true;
options.MaxWidth = MaxWidth.Medium;
options.DialogAppearance = MudExAppearance.FromCss(cls);
}); |
First sorry for late answering, I was not availble last week. However your code is in general correct, but problem is the original MudBlazor dialog handling overwrites your size. What you can do to solve this is create a css class with height auto as important for the dialog and asign them like you do with
MudExAppearance.FromCss("<your_class_name>")If you need to do it in c# you can do it like this for example