Unified display runtime enabling C# code execution in both desktop and browser environments.
Platform → UI Technology → Clients | WebAssembly | Symbols | Drawing | Responsive | Layouts
WebAssembly (Wasm) is a binary instruction format that enables compiled code to run in web browsers. FrameworX uses Blazor WebAssembly to compile C# display code into WebAssembly modules, allowing the same display logic to execute in both WPF desktop applications and web browsers.
Portable displays enable a single display configuration to run across multiple client types. The display markup (XAML) and business logic (C#) remain consistent—only the runtime environment changes:
Environment | Runtime | Execution Model | Capabilities |
---|---|---|---|
Desktop (WPF) | .NET Framework | Multi-threaded native | Full OS access, hardware control |
Browser (WebAssembly) | Blazor WebAssembly | Single-threaded sandbox | Browser APIs, cross-platform |
The compilation and execution process:
// This C# code runs in both WPF and WebAssembly
public void UpdateValue(double value)
{
if (value > AlarmLimit)
{
TriggerAlarm();
LogEvent("Limit exceeded: " + value);
}
UpdateDisplay(value);
}
The same business logic executes in both environments. Platform-specific code is isolated in conditional compilation blocks when needed.
Aspect | Desktop (WPF) | WebAssembly |
---|---|---|
Startup Time | Fast (local resources) | Slower (download runtime) |
Execution Speed | Native performance | ~70% of native speed |
Memory Usage | Direct OS management | Browser heap limits |
Threading | Full multi-threading | Single-threaded |
Data Points | 10,000+ simultaneous | 1,000s practical limit |
WebAssembly applications require downloading the .NET runtime and application assemblies:
WebAssembly support in modern browsers:
Use Portable Displays | Use Platform-Specific |
---|---|
Standard monitoring screens | Hardware control interfaces |
Dashboard visualizations | High-frequency data updates (>100Hz) |
Report displays | Multi-threaded processing needs |
Cross-platform requirements | OS-specific integrations |
Remote access scenarios | Local peripheral access |
Creating portable displays:
// Conditional code when platform-specific behavior needed
#if WEBASSEMBLY
// Browser-specific implementation
await JSRuntime.InvokeVoidAsync("alert", message);
#else
// Desktop-specific implementation
MessageBox.Show(message);
#endif
The portable display architecture provides: