Hi,
i'd like to resize the diagram palette programmatically at runtime.
This is required because i'd like to offer a simple and an advanced toolset of shapes.
I tried all available state modifier for blazor, but no one seems to have an effect.
public async Task AdjustPalette()
{
optionalPalette.Expanded = !optionalPalette.Expanded;
this.AdjustSize(); // recalculating size
this.Refresh();
await this.Render();
await this.InvokeAsync(this.StateHasChanged);
}
protected void AdjustSize()
{
var width = (requiredPalette.Symbols as List<object>)?.Count ?? 0;
width += optionalPalette.Expanded ? (optionalPalette.Symbols as List<object>)?.Count ?? 0 : 0;
base.Height = "70px";
base.Width = $"{width * (base.SymbolWidth + 2)}px";
}
protected override void OnInitialized()
{
base.Palettes = new List
{
requiredPalette,
optionalPalette
};
base.SymbolWidth = 60;
base.SymbolHeight = 60;
base.SymbolMargin = new SymbolMargin { Left = 4, Right = 4, Top = 4, Bottom = 4 };
this.AdjustSize();
}