One liner.Unified display runtime enabling C# code execution in both desktop and browser environments
Platform → UI Technology→ Clients | WebAssembly | Symbols | Drawing | Responsive | Layouts
Table of Contents maxLevel 2 minLevel 2 indent 10px exclude Steps style none
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.
Table of Contents maxLevel 2 minLevel 2 indent 10px exclude Steps style none
Portable Display Architecture
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#
at near-native speed. It allows code written in languages like C# to be compiled and executed directly in browsers, eliminating the traditional performance gap between desktop and web applications.The fundamental challenge in industrial automation has always been the trade-off between powerful desktop clients and accessible web interfaces. WebAssembly changes this equation entirely.
With FrameworX's WebAssembly implementation, a single display configuration can run:
The display markup (XAML) remains consistent - only the runtime changes.
For control room operations, native desktop clients provide irreplaceable capabilities:
See Desktop, Web & Mobile Clients for detailed client comparisons.
Modern operations demand web access for:
Traditional approaches forced a choice:
This meant maintaining two codebases, doubling development effort, and risking inconsistencies.
WebAssembly enables the same C# code to execute in both environments:
csharp
// This exactcode runs in both WPF and WebAssembly public void
UpdateTemperatureUpdateValue(double value) { if (value > AlarmLimit) { TriggerAlarm(); LogEvent(
$"
TemperatureLimit exceeded: "
{+ value
}°C"); } UpdateDisplay(value); }
WebAssembly delivers performance previously impossible in browsers:
Traditional HTML5/JavaScript architectures struggle with:
WebAssembly handles these scenarios natively.
The entire data pipeline runs in compiled code:
Only the final rendering uses browser APIs.
Beyond displays, WebAssembly enables code sharing across:
Modern browsers with WebAssembly support:
WebAssembly transforms the traditional desktop-vs-web dilemma into a unified solution. Industrial applications no longer sacrifice power for portability or accessibility for control. The same C# code, the same business logic, and the same displays run everywhere - from locked-down control rooms to mobile devices in the field.
This is not about replacing desktop applications or making everything web-based. It's about having the freedom to deploy the right client for each use case without multiplying development effort.
Related Topics:
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:
Page Tree | ||||
---|---|---|---|---|
|