# UI Layout Definition Format **Version:** 1.1 **Documentation Version:** 1.1 **Author:** Dalibor Votruba **URL:** [quadarax.com/ui-layout-def](https://quadarax.com/ui-layout-def) A comprehensive XML-based format for describing user interface layouts with inheritance, pattern definitions, view organization, and platform-specific extensions. This format enables cross-platform UI generation with strict validation and modular component libraries. ## Table of Contents - [Overview](#overview) - [Core Concepts](#core-concepts) - [Document Structure](#document-structure) - [View Definitions (NEW)](#view-definitions) - [Pattern Definitions](#pattern-definitions) - [Control Definitions](#control-definitions) - [Wireframe Inheritance](#wireframe-inheritance) - [Window Definitions](#window-definitions) - [Validation System](#validation-system) - [External Includes](#external-includes) - [Examples](#examples) - [Best Practices](#best-practices) - [Platform Support](#platform-support) ## Overview The UI Layout Definition Format provides a standardized way to define user interfaces that can be translated to various platforms (Windows Forms, WPF, Qt, Web, Mobile). It emphasizes: - **View-Based Organization**: Logical grouping of related UI components by business function - **Separation of Concerns**: Pattern definitions separate from usage - **Inheritance**: Base wireframes and views with specific overrides - **Validation**: Strict constraints ensure consistent, valid UIs - **Modularity**: External pattern, view, and validation includes - **Cross-Platform**: Platform-specific control libraries - **MVVM Support**: Direct mapping to view models and business logic ## Core Concepts ### 1. View-First Design (NEW in v1.1) Views represent logical business functions (ProductView, OrderView) that group related windows and define shared data context and behaviors. ### 2. Patterns-First Design All controls and structures must be defined in the `` section before use in windows. ### 3. Inheritance Hierarchy - Views can inherit from other views - Controls can inherit from other controls - Windows can inherit from wireframe layouts - Attributes can be overridden at any level ### 4. Slot-Based Composition Wireframes use slots as placeholders that windows can fill with specific content. ### 5. Constraint Validation Comprehensive validation rules ensure UI consistency and platform compliance. ## Document Structure ```xml ... ... ... ... ... ``` ## View Definitions ### View Concept Views are logical containers that group related windows, dialogs, and UI components that work together for a specific business function. They provide: - **Logical Organization**: Group UI components by business purpose - **Data Context**: Shared state management within the view - **Navigation**: Centralized navigation logic - **Dependencies**: Clear relationships between views - **Code Generation**: Generate view classes with proper structure ### Basic View Structure ```xml Product management functionality including listing, editing, and details Product ProductViewModel ProductController product.read,product.write ``` ### View Types and Categories **View Types:** - `business-entity` - Product, Order, Customer management - `process-flow` - OrderProcessing, Checkout workflows - `dashboard` - MainDashboard, ReportsView - `utility` - Settings, UserPreferences - `wizard` - Setup wizards, guided processes - `composite` - Views composed of multiple sub-views - `module` - Application modules containing multiple views **Categories:** - `core` - Essential business functionality - `admin` - Administrative functions - `reporting` - Reports and analytics - `system` - System-level functionality - `framework` - Base views for inheritance ### View Inheritance ```xml ``` ### View Dependencies and Relationships ```xml ``` ### Composite Views ```xml Complete order management including orders, items, and customer details ``` ## Pattern Definitions ### Control Definition ```xml Panel,FormField none false ``` #### Control Properties - **name**: Unique identifier for the control type - **type**: Control category (action, input, display, container, data, navigation) - **category**: Platform grouping (basic, windows-specific, web-specific, etc.) - **inherits**: Optional parent control to inherit from #### Constraints - **allowed-parents**: List of controls that can contain this control - **allowed-children**: List of controls this control can contain - **container**: Boolean indicating if control can contain children - **max-children**: Maximum number of child controls allowed - **requires-structure**: Required structural elements #### Attributes - **name**: Attribute identifier - **type**: Data type (string, int, bool, enum, color, date, etc.) - **default**: Default value - **required**: Whether attribute must be specified - **min/max**: Value constraints for numeric types - **values**: Allowed values for enum types ### Structure Definition ```xml Panel input ``` ### Wireframe Definition ```xml Standard application layout with header, sidebar, content, footer ``` ## Wireframe Inheritance Windows can inherit from wireframe layouts and override specific slots: ```xml main true mainData