@using System.Drawing
@using System.Globalization

<div style="@GetColor min-width: @WebReport.Dialog.Zoom(dialogPage.Width)px !important; min-height: @WebReport.Dialog.Zoom(dialogPage.Height)px !important">
    <div id="@WebReport.ID-Dialog" style="position: relative;" title="@dialogPage.Text">
        <ControlsComponent Controls="dialogPage.Controls" WebReport="WebReport"/>
    </div>
</div>

@code {
    [Parameter]
    public WebReport WebReport { get; set; }

    [Parameter]
    public DialogPage dialogPage { get; set; }

    protected override void OnParametersSet()
    {
        base.OnParametersSet();
        WebReport.Dialog.SetScaling(dialogPage);
    }

    private string GetColor
    {
        get
        {
            if (dialogPage.BackColor != Color.Empty)
                return $"background-color: {ColorTranslator.ToHtml(dialogPage.BackColor)};";
            return string.Empty;
        }
    }
}
