Ir al contenido principal

.NET MAUI project structure

 

Project Structure

  1. Main Project Directory:

    • : This file is used for application-level resources, such as styles and themes.

    • : Contains the code-behind for the file, including the application entry point.

    • : The main page of your application, which defines the UI layout in XAML.

    • : The code-behind for MainPage.xaml, where you implement the logic for the main page.

  2. Platforms:

    • Android: Contains platform-specific code for Android, such as and

    • iOS: Contains platform-specific code for iOS, such as and

    • MacCatalyst: Contains platform-specific code for Mac Catalyst, such as and

    • WinUI: Contains platform-specific code for Windows, such as and

  3. Resources:

    • Fonts: Contains font files used in the application.

    • Images: Contains image assets used in the application.

    • Styles: Contains styles and themes used in the application.

  4. ViewModels: Contains view model classes that handle the application's logic and data binding.

  5. Views: Contains XAML files and their code-behind files for different pages and controls in the application.

  6. Models: Contains data models used in the application.

Example Project Structure

MyMauiApp
│
├── App.xaml
├── App.xaml.cs
├── MainPage.xaml
├── MainPage.xaml.cs
│
├── Platforms
│   ├── Android
│   │   ├── AndroidManifest.xml
│   │   ├── MainActivity.cs
│   │   └── ...
│   ├── iOS
│   │   ├── Info.plist
│   │   ├── AppDelegate.cs
│   │   └── ...
│   ├── MacCatalyst
│   │   ├── Info.plist
│   │   ├── AppDelegate.cs
│   │   └── ...
│   └── WinUI
│       ├── Package.appxmanifest
│       ├── App.xaml.cs
│       └── ...
│
├── Resources
│   ├── Fonts
│   │   └── ...
│   ├── Images
│   │   └── ...
│   └── Styles
│       └── ...
│
├── ViewModels
│   └── ...
│
├── Views
│   └── ...
│
└── Models
    └── ...

Key Files

  • & : Define global resources and handle application startup.

  • & : Define the main user interface and its behavior.

  • Platform-Specific Folders: Contain code and resources specific to each platform (Android, iOS, etc.).

Comentarios

Entradas populares de este blog

Actualizar Ruby con RVM en OS X 10.9 Maverick

Cocoapods me pide una versión de Ruby mayor que 2.0, pero Maverick viene por defecto con 1.9.3 así que tiré de rvm pensando que serían un par de líneas pero no, he pasado un buen rato en el proceso. Hagamos el cuento corto: $rvm list known y no aparece ninguna versión 2 o superior, así que: $rvm get latest y ahora con: $rvm list known tenemos: # MRI Rubies [ruby-]1.8.6[-p420] [ruby-]1.8.7[-head] # security released on head [ruby-]1.9.1[-p431] [ruby-]1.9.2[-p330] [ruby-]1.9.3[-p551] [ruby-]2.0.0[-p643] [ruby-]2.1.4 [ruby-]2.1[.5] [ruby-]2.2[.1] [ruby-]2.2-head ruby-head ahora si, $rvm install 2.2.1 pero Error running 'requirements_osx_brew_libs_install automake libtool libksba', showing last 15 lines of /Users/hedmon/.rvm/log/1428514809_ruby-2.2.1/package_install_automake_libtool_libksba.log Las dependencias estaban instaladas pero no linkeadas, así que vamos a resolverlo con Homebrew. $brew update $brew upgrade ...

Eclipse total de sol, 20 de marzo de 2015

La vida me premió con la oportunidad de ver un evento astronómico espectacular como es un eclipse de sol, que unos pocos afortunados más al norte pudieron disfrutarlo en su versión total, aunque desde el centro de Europa pudimos apreciar más de un 70% del fenómeno y con un clima despejado. El cielo despejado permitió disfrutar el eclipse completo  La diferencia de luz fue notable. A la derecha durante el eclipse, a la izquierda minutos después de concluir.

Step-by-step guide to creating a .NET MAUI application for Android

   Step 1: Set Up Your Development Environment Install Visual Studio 2022 : Make sure you have Visual Studio 2022 installed with the .NET MAUI workload. Install Android SDK and Emulator : Ensure you have the Android SDK and an Android emulator installed. Step 2: Create a New .NET MAUI Project Open Visual Studio 2022 : Launch Visual Studio. Create a New Project : Click on "Create a new project" in the start window. Select .NET MAUI App Template : Choose "MAUI" in the project type drop-down, select the ".NET MAUI App" template, and click "Next". Configure Your Project : Name your project, choose a location, and click "Next". Choose .NET Version : Select the version of .NET you want to target and click "Create". Step 3: Set Up Your Project Explore Project Structure : Familiarize yourself with the project structure, dependencies, and files. Create XAML Pages : Start designing your app's user interface using XAML. Step 4: Write...