@using DevExpress.Blazor @if (_isFullscreen) {
@(_currentGrid?.Caption ?? "Grid")
@RenderMainContent()
} else { @RenderMainContent() }
@code { private IInfoPanelBase? _infoPanelInstance; private IMgGridBase? _currentGrid; private bool _isFullscreen; /// /// The grid content to display in the left pane /// [Parameter] public RenderFragment? GridContent { get; set; } /// /// InfoPanel content (e.g., GridShippingDocumentInfoPanel) to display in the right pane. /// If not set, the default MgGridInfoPanel is used. /// [Parameter] public RenderFragment? ChildContent { get; set; } /// /// Initial size of the InfoPanel pane. Default is "400px". /// [Parameter] public string InfoPanelSize { get; set; } = "400px"; /// /// Whether to show the InfoPanel. Default is true. /// [Parameter] public bool ShowInfoPanel { get; set; } = true; /// /// Whether the wrapper is currently in fullscreen mode /// public bool IsFullscreen => _isFullscreen; /// /// Gets or sets the InfoPanel instance for grid-InfoPanel communication /// public IInfoPanelBase? InfoPanelInstance { get => _infoPanelInstance; set => _infoPanelInstance = value; } /// /// Registers an InfoPanel instance (called by child InfoPanel components) /// public void RegisterInfoPanel(IInfoPanelBase infoPanel) { _infoPanelInstance = infoPanel; } /// /// Registers the grid instance (called by MgGridBase) /// public void RegisterGrid(IMgGridBase grid) { _currentGrid = grid; } /// /// Toggles fullscreen mode /// public void ToggleFullscreen() { _isFullscreen = !_isFullscreen; StateHasChanged(); } /// /// Enters fullscreen mode /// public void EnterFullscreen() { _isFullscreen = true; StateHasChanged(); } /// /// Exits fullscreen mode /// public void ExitFullscreen() { _isFullscreen = false; StateHasChanged(); } private RenderFragment RenderMainContent() => __builder => { if (ShowInfoPanel) { @GridContent @if (ChildContent != null) { @ChildContent } else { } } else { @GridContent } }; }