The UI Designer enables visual PXAML development in VS Code - a WYSIWYG editor for Pascal-based user interfaces.
The Designer provides:
PXAML (Pascal XAML) is an XML-based markup format for user interfaces, inspired by WPF/XAML.
<Window Title="Hello PXAML" Width="400" Height="300"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Label Grid.Row="0" Content="Welcome!" FontSize="24"/> <StackPanel Grid.Row="1" Orientation="Vertical" Margin="10"> <TextBox x:Name="txtInput" PlaceholderText="Enter name..."/> <Button Content="Greet" Click="OnGreetClick"/> </StackPanel> </Grid> </Window>
| Aspect | PXAML | LFM (Lazarus) |
|---|---|---|
| Format | XML | Proprietary (Binary or Text) |
| Readability | High | Medium |
| Version Control | Excellent (diff-friendly) | Difficult |
| Designer | WvdS Designer | Lazarus IDE |
| Targets | GUI, TUI, Web | GUI only |
| Command | Keyboard Shortcut | Description |
|---|---|---|
WVDS Designer: New PXAML File | - | Creates a new PXAML file |
WVDS Designer: Toggle Designer Preview | - | Switches between code and design view |
WVDS Designer: Show Properties Panel | - | Shows the properties panel |
Ctrl+Shift+P → WVDS Designer: New PXAML FileWhen you open a .pxaml file, the designer is automatically activated.
The editor shows:
To edit the PXAML source code:
Via Drag & Drop:
Via Code:
<Window xmlns="http://schemas.wvds.de/pxaml/2024" xmlns:x="http://schemas.wvds.de/pxaml/x/2024" xmlns:local="clr-namespace:MyApp"> </Window>
| Namespace | Usage |
|---|---|
| Standard (no prefix) | Base controls (Button, TextBox, Grid, …) |
| x: | Markup extensions (x:Name, x:Key, …) |
| local: | Custom types from the project |
| Container | Description |
|---|---|
| Grid | Row and column layout |
| StackPanel | Stacks elements horizontally or vertically |
| DockPanel | Docks elements to edges |
| Canvas | Absolute positioning |
| WrapPanel | Wrapping arrangement |
| Control | Description |
|---|---|
| Button | Button with click event |
| TextBox | Single-line text input |
| Label | Text display |
| CheckBox | On/off selection |
| ComboBox | Dropdown selection |
| ListBox | List selection |
| Image | Image display |
| Border | Border and background |
<TextBox Text="{Binding Path=UserName, Mode=TwoWay}"/> <Label Content="{Binding Path=WelcomeMessage}"/>
<Button Content="Save" Click="OnSaveClick"/>
The handler is implemented in the code-behind unit:
procedure TMainWindow.OnSaveClick(Sender: TObject); begin // Save logic end;
The Designer uses the settings of the UI Meta extension for IntelliSense and component information.
PXAML can be rendered for different targets:
| Target | Description | Renderer |
|---|---|---|
| GUI | Native desktop interface | LCL-based |
| TUI | Terminal interface | Text-based |
| Web | Browser interface | HTML/CSS |
The selection is made at build time, not in the Designer.
Cause: PXAML syntax error or missing components.
Solution:
Cause: Auto-refresh disabled or error.
Solution:
Ctrl+S)WVDS: Refresh Preview manuallyCause: Wrong area or unsupported container.
Solution:
| Property | Value |
|---|---|
| Extension ID | wvds.wvds-vscode-ui-designer |
| Activation | onCustomEditor:wvds.ui.designer.pxaml |
| Dependencies | wvds-vscode-core |
| Min. VS Code | 1.85.0 |
| File Format | .pxaml |