A powerful web-based visual designer for creating MAUI (Microsoft App UI) layouts with drag-and-drop functionality. This Angular application provides an intuitive interface for designing XAML-based user interfaces with real-time preview capabilities.
- Drag-and-Drop Interface: Intuitive visual design with drag-and-drop functionality
- Element Toolbox: Comprehensive collection of MAUI controls and layouts
- Properties Panel: Real-time property editing with immediate visual feedback
- Hierarchy Panel: Tree view of element structure for easy navigation
- Resizable Panels: Customizable workspace with adjustable panel sizes
- XAML Editor: Full-featured code editor with syntax support
- Real-time Preview: Instant visual updates when applying XAML changes
- XAML Generation: Export designed layouts as clean XAML code
- XAML Parsing: Import existing XAML files to recreate visual designs
- Copy & Download: Easy sharing and saving of generated XAML
- Label: Text display with formatting options
- Button: Interactive buttons with styling
- Entry: Single-line text input fields
- Editor: Multi-line text input areas
- Image: Image display with positioning
- StackLayout: Vertical/horizontal stacking of elements
- Grid: Row and column-based layouts with spanning
- AbsoluteLayout: Precise positioning with coordinates
- Frame: Containers with borders and backgrounds
- ScrollView: Scrollable content areas
Before you begin, ensure you have the following installed:
- Node.js (version 16.x or higher)
- npm (version 8.x or higher)
- Angular CLI (version 18.x)
-
Clone the repository:
git clone https://github.com/GMPrakhar/MAUI-Designer.git cd MAUI-Designer -
Install dependencies:
npm install
-
Install Angular CLI globally (if not already installed):
npm install -g @angular/cli
Start the development server:
npm start
# or
ng serveNavigate to http://localhost:4200/ in your browser. The application will automatically reload when you make changes to the source files.
Build the project for production:
npm run build
# or
ng buildThe build artifacts will be stored in the dist/ directory.
Execute the unit tests:
npm test
# or
ng test- Select a Layout Container: Start by adding a layout container (StackLayout, Grid, or AbsoluteLayout) from the toolbox
- Add Controls: Drag controls like Label, Button, or Entry from the toolbox to your layout
- Configure Properties: Use the Properties panel to customize appearance, text, colors, and positioning
- Preview XAML: Check the XAML tab to see the generated code in real-time
The toolbox is organized into three categories:
- Controls: Interactive elements like buttons, labels, and input fields
- Layouts: Containers that organize child elements (StackLayout, Grid, AbsoluteLayout)
- Views: Specialized containers like Frame and ScrollView
The Properties panel allows you to modify:
- Layout Properties: Position (x, y), size (width, height), margins, padding
- Visual Properties: Background color, text color, font family, font size
- Content Properties: Text content, images, and other element-specific properties
- Grid Properties: Row/column position and spanning for Grid layouts
- Apply Changes: Click the "Apply" button to update the visual design from XAML code
- Reset: Revert to the current visual design state
- Copy: Copy the generated XAML to clipboard
- Download: Save the XAML as a file
- View the complete element structure
- Select elements for editing
- Navigate complex layouts easily
src/
βββ app/
β βββ components/ # UI Components
β β βββ designer-canvas/ # Main design surface
β β βββ hierarchy-panel/ # Element tree view
β β βββ properties-panel/ # Property editor
β β βββ toolbox/ # Element toolbox
β β βββ xaml-editor/ # XAML code editor
β βββ models/ # Data models
β β βββ maui-element.ts # MAUI element definitions
β β βββ toolbox.ts # Toolbox item definitions
β βββ services/ # Business logic services
β β βββ drag-drop.ts # Drag-and-drop functionality
β β βββ element.ts # Element management
β β βββ layout-designer.ts # Layout calculations
β β βββ xaml-generator.ts # XAML code generation
β β βββ xaml-parser.ts # XAML parsing
β βββ app.ts # Main app component
βββ styles.scss # Global styles
βββ index.html # Main HTML file
The application follows Angular's standalone components architecture with a service-based approach:
- Components: Each UI panel is a standalone component with its own logic
- Services: Business logic is centralized in injectable services
- Models: TypeScript interfaces define data structures for MAUI elements
- Reactive Programming: Uses RxJS for state management and real-time updates
- ElementService: Manages element creation, selection, and hierarchy
- LayoutDesignerService: Handles layout calculations and positioning
- XamlGeneratorService: Converts visual designs to XAML code
- XamlParserService: Parses XAML code into visual elements
- DragDropService: Manages drag-and-drop interactions
- Define the element type in
models/maui-element.ts - Add toolbox entry in
models/toolbox.ts - Implement element creation in
services/element.ts - Add XAML generation logic in
services/xaml-generator.ts - Update parser in
services/xaml-parser.ts
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and ensure they follow the coding standards
- Test your changes thoroughly
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
- Follow Angular coding style guidelines
- Write unit tests for new features
- Ensure all existing tests pass
- Update documentation as needed
- Use meaningful commit messages
- Frontend Framework: Angular 18.2.0
- UI Components: Angular Material 18.2.0
- Drag & Drop: Angular CDK 18.2.0
- Language: TypeScript 5.5.4
- Styling: SCSS
- State Management: RxJS 7.8.0
- Build Tool: Angular CLI 18.2.0
- Testing: Jasmine & Karma
- Build may fail in environments without internet access due to Google Fonts dependency
- Some advanced XAML features are not yet supported
- Complex nested layouts may require manual XAML adjustments
This project is licensed under the MIT License - see the LICENSE file for details.
GMPrakhar - GitHub Profile
- Microsoft MAUI team for the excellent UI framework
- Angular team for the robust web framework
- Contributors and community members
Happy Designing! π¨