Prism Framework

repository·master·Indexed 27 days ago

https://github.com/prismlibrary/prism

A comprehensive framework for building structured, maintainable XAML-based applications using MVVM and Dependency Injection. Prism supports multiple .NET platforms, including WPF, MAUI, Avalonia, Uno Platform, and WinUI. It provides core functionality for loosely coupled applications through features like EventAggregator and Commands, with dedicated NuGet packages for various UI frameworks and IoC containers such as DryIoc and Unity.

Tokens
6K
Snippets
6
Records
36
Agent score
92%

What's inside Prism

  1. Overview of Prism Framework

    master

    Prism is a framework designed for building loosely coupled, maintainable, and testable XAML applications. It supports multiple platforms including WPF, Avalonia, MAUI, Uno Platform, and WinUI.

    Prism implements several key design patterns to help structure XAML applications:

    • MVVM (Model-View-ViewModel)
    • Dependency Injection
    • Commands
    • EventAggregator

    Core functionality is shared via a codebase supporting .NET Standard 2.0, .NET Framework 4.6 / 4.7, and .NET 6.0/.NET 8.0, while platform-specific implementations are provided in dedicated libraries.

  2. Prism Licensing Information

    master

    Prism 9.0 uses a Dual License model:

    • Community License: Free for the vast majority of the community.
    • Commercial License: Required for larger organizations to support Prism development.
    • Commercial Plus License: Provides access to additional support libraries and a private Discord channel for interacting with the Prism Team.
  3. Build considerations for HelloWorld solution

    master

    The HelloWorld.slnx solution file includes Prism library projects.

    Important: Do not pass a single -f (target framework) flag to the entire solution. Doing so forces every project in the solution, including Prism.Core, onto a single TFM. Instead, build the HelloWorld.csproj project individually for each TFM as described in the CLI build guides.

  4. Build the Prism Uno HelloWorld sample for WinUI

    master

    Uno prevents using dotnet build for WinUI class libraries that contain XAML (error UNOB0008). To build the Windows TFM, you must use Visual Studio or msbuild.

    Use the following command to build with the specific Windows target framework:

    msbuild .\e2e\Uno\HelloWorld\HelloWorld.csproj -restore -p:TargetFramework=net10.0-windows10.0.26100
  5. Report a bug in Prism.Avalonia

    master

    If you encounter a bug, follow these requirements to ensure your report is not closed:

    1. Search first: Check existing open and closed issues to see if the bug has already been reported or fixed.
    2. Provide a reproduction sample: You MUST create a new, minimal project that focuses ONLY on the necessary steps to reproduce the issue. Issues without a sample app reproducing the issue will be closed.
    3. Avoid 'Archaeology': Do not comment on old Pull Requests, commits, or issues. If you find a legitimate issue related to old work, open a new issue and reference the relevant old items.
  6. Get support for Prism.Avalonia

    master

    Prism is distributed under the MIT License "AS IS", without warranty.

    • Enterprise Support: For code-level support, architectural guidance, or custom builds, contact the Prism team via https://github.com/PrismLibrary/Prism to inquire about Enterprise support options.
    • Community Support: For general questions, use GitHub Discussions on the main Prism repository. Avoid using GitHub Issues for questions; Issues are reserved for feature requests and bug reports.
    • Stack Overflow: You may ask questions on Stack Overflow, but note that the Prism team does not monitor that platform.
  7. Access Prism Support and Documentation

    master

    If you need assistance with Prism, use the following channels:

    Note: The Prism Team does not support or engage with questions on StackOverflow.

  8. Determine Prism licensing requirements

    master

    Prism is available under two licensing models: the Prism Community License (free) and the Prism Commercial License (paid). You must possess one of these licenses and agree to Prism's terms and conditions to use the software.

    Prism Community License Criteria

    You qualify for the free Community License only if you meet all of the following requirements:

    • Annual gross revenue is less than one million U.S. dollars ($1,000,000.00 USD).
    • You have fewer than five (5) total developers.
    • You have never received more than $3 million USD in capital from outside sources (e.g., private equity or venture capital).

    Prism Commercial License

    If you do not meet all the criteria for the Community License, you must purchase a Commercial License. Visit the Prism Library website to explore options.

  9. Install Prism NuGet packages

    master
    Prism is distributed via NuGet packages categorized into Core, Container-specific, and UI Framework-specific packages. To use Prism in your project, select the package that matches your target framework and preferred Dependency Injection (DI) container.
  10. Find stable Prism application samples

    master
    For production-ready guidance and complete application examples, use the stable samples hosted in separate repositories under the PrismLibrary GitHub organization. These samples are based on publicly released NuGet packages and are more stable than the sandbox samples found in this repository. Use these to understand how to implement Prism in specific frameworks like WPF or Xamarin.Forms.
  11. Install Prism via NuGet

    master

    Prism is distributed via NuGet packages. To use Prism, you must install the core packages for your target platform and the specific IoC container package you intend to use.

    Core Platform Packages

    • Cross Platform: Prism.Core, Prism.Events, Prism.Container.Abstractions, Prism.Container.DryIoc, Prism.Container.Unity
    • WPF: Prism.Wpf
    • Avalonia: Prism.Avalonia
    • .NET MAUI: Prism.Maui
    • Uno Platform / WinUI: Prism.Uno

    Container-Specific Packages

    Starting from version 7.0, Prism uses separate packages for each combination of Container and Platform. You must install the package that matches both your platform and your chosen IoC container (e.g., Prism.DryIoc.Wpf or Prism.Unity.Wpf).

    Available Container/Platform combinations include:

    • WPF: Prism.DryIoc, Prism.Unity
    • Avalonia: Prism.DryIoc.Avalonia
    • .NET MAUI: Prism.DryIoc.Maui, Prism.Maui.Rx
    • Uno Platform: Prism.DryIoc.Uno