![]() |
VOOZH | about |
dotnet add package MeshWeaver.Layout --version 2.5.0
NuGet\Install-Package MeshWeaver.Layout -Version 2.5.0
<PackageReference Include="MeshWeaver.Layout" Version="2.5.0" />
<PackageVersion Include="MeshWeaver.Layout" Version="2.5.0" />Directory.Packages.props
<PackageReference Include="MeshWeaver.Layout" />Project file
paket add MeshWeaver.Layout --version 2.5.0
#r "nuget: MeshWeaver.Layout, 2.5.0"
#:package MeshWeaver.Layout@2.5.0
#addin nuget:?package=MeshWeaver.Layout&version=2.5.0Install as a Cake Addin
#tool nuget:?package=MeshWeaver.Layout&version=2.5.0Install as a Cake Tool
MeshWeaver.Layout provides core abstractions for UI controls in the MeshWeaver ecosystem. It defines view models that can be implemented by different UI frameworks (like Blazor) and supports data binding, templating, and interactive updates.
// Configure layout in message hub
configuration
.AddLayout(layout =>
layout
.WithView(
"StaticView",
Controls.Stack.WithView("Hello", "Hello").WithView("World", "World")
)
.WithView("ViewWithProgress", ViewWithProgress)
.WithView("UpdatingView", UpdatingView())
.WithView(
"ItemTemplate",
layout.Hub.GetWorkspace()
.GetStream(typeof(DataRecord))
.Select(x => x.Value.GetData<DataRecord>())
.DistinctUntilChanged()
.BindMany(record => Controls.Text(record.DisplayName))
)
);
// Configure layout client
configuration.AddLayoutClient();
// Stack of HTML controls
Controls.Stack
.WithView("Hello", "Hello")
.WithView("World", "World")
// Binding to a data model
record Toolbar(int Year);
var toolbar = new Toolbar(2024);
return Controls.Stack
.WithView(
Template.Bind(
toolbar,
tb => Controls.Text(tb.Year),
"toolbar"
),
"Toolbar"
)
.WithView((area, _) =>
area.GetDataStream<Toolbar>("toolbar")
.Select(tb => Controls.Html($"Report for year {tb.Year}")),
"Content"
);
// Counter with click action
Controls.Stack
.WithView(
Controls.Html("Increase Counter")
.WithClickAction(context =>
context.Host.UpdateArea(
new("Counter/Counter"),
Controls.Html((++counter))
)
),
"Button"
)
.WithView(
Controls.Html(counter.ToString()),
"Counter"
);
// Data grid with columns
var data = new DataRecord[] { new("1", "1"), new("2", "2") };
return area.ToDataGrid(data, grid => grid
.WithColumn(x => x.SystemName)
.WithColumn(x => x.DisplayName)
);
// Template for repeating items
data.BindMany(record =>
Controls.Text(record.DisplayName)
.WithId(record.SystemName)
);
// Updating progress
var percentage = 0;
var progress = Controls.Progress("Processing", percentage);
for (var i = 0; i < 10; i++)
{
await Task.Delay(30);
area.UpdateProgress(
new("ViewWithProgress"),
progress = progress with { Progress = percentage += 10 }
);
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on MeshWeaver.Layout:
| Package | Downloads |
|---|---|
|
MeshWeaver.Mesh.Contract
Package Description |
|
|
MeshWeaver.Kernel
Package Description |
|
|
MeshWeaver.Blazor
Package Description |
|
|
MeshWeaver.GridModel
Package Description |
|
|
MeshWeaver.Hosting.Blazor
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-preview1 | 227 | 4/16/2026 |
| 2.5.0 | 481 | 11/3/2025 |
| 2.4.0 | 441 | 10/2/2025 |
| 2.3.0 | 442 | 8/4/2025 |
| 2.2.0 | 716 | 7/21/2025 |
| 2.1.0 | 366 | 4/6/2025 |
| 2.0.3 | 686 | 3/24/2025 |
| 2.0.2 | 662 | 3/24/2025 |
| 2.0.1 | 313 | 3/21/2025 |
| 2.0.0 | 349 | 3/20/2025 |
| 2.0.0-preview3 | 278 | 2/28/2025 |
| 2.0.0-Preview2 | 327 | 2/10/2025 |
| 2.0.0-preview1 | 296 | 1/6/2025 |
| 1.0.1 | 261 | 10/8/2024 |
| 1.0.0 | 241 | 10/8/2024 |