Skip to content

SPuV/dotnet-maui-samples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET MAUI Samples

Completed samples will be uploaded into this repository so that it is accessible to everyone.

Join me on Developer Thoughts, an exclusive blog for .NET MAUI and Blazor, for articles on working with these samples.

Note: Samples are in the process of migrating to the latest framework version, so there would be a change in the directory structure. Kindly bear with this.

Made available in the src\NET_8\ directory:

  • EmbeddedWindows - .NET MAUI Page embedded in a Native WinUI 3 App, targeting .NET 8 (net8.0-windows10.0.19041.0)
    • Refer to this article for working with this sample
  • MapsApp - .NET MAUI Maps embedded in a Native WinUI 3 App, targeting .NET 8 (net8.0-windows10.0.19041.0)
    • Refer to this article for working with this sample
  • ThemedApp - Sample app for .NET MAUI App Theming
    • Refer to this article for further details
  • DateCalculator
    • MVVM Sample
    • Xamarin Forms and .NET MAUI in a single solution
    • WPF and WinUI projects to illustrate the reuse of ViewModels across UI frameworks
    • WinForms project to illustrate the reuse of ViewModels across non-XAML UI framework too
    • Shared business logic as a separate library project
    • ViewModels implemented with CommunityToolkit.Mvvm NuGet package
  • UnifiedDateCalculator
    • Shared class library sample
    • UI, ViewModel, Model, and Business logic all from shared project
    • Head projects serve as an app container
    • Both Xamarin.Forms and .NET MAUI from a single project - DateCalculator.UI

Made available in the src\NET_9\ directory:

  • EmbeddedWindows - .NET MAUI Page embedded in a Native WinUI 3 App, targeting .NET 9 (net9.0-windows10.0.19041.0)
    • Refer to this article for working with this sample
  • MapsApp - .NET MAUI Maps embedded in a Native WinUI 3 App, targeting .NET 9 (net9.0-windows10.0.19041.0)
    • Refer to this article for working with this sample

Made available in the the src\ directory:

  • TestApp - .NET MAUI Shell sample
  • MenuApp - .NET MAUI sample app with multi-level menu definition in both XAML and C# (Will work only on Desktop form factor)
  • MauiBlazorApp - .NET MAUI Blazor sample
    • App Theming
    • State sharing between .NET MAUI and Razor Components
    • Components from shared Razor Class Library (RCL)
  • MauiAppCS - .NET MAUI C# Markup based Sample
  • EmbeddedAndroid - .NET MAUI Page embedded in a Native Android App, targeting .NET 6 (net6.0-android)
  • MediaElement - Sample project in both .NET 6 and 7. Now made available in Preview bits as part of the .NET MAUI CommunityToolkit - And it'll be a separate NuGet package titled CommunityToolkit.Maui.MediaElement
  • MauiHotReload - Sample project to demonstrate C# Hot Reload feature supported via MetadataUpdateHandler (refer to HotReloadService.cs). Core logic is abstracted into a base page named MauiPage, inherit the content pages from it and implement the UI logic in the override of the abstract Build() method. Source is available in the src\MauiHotReload folder.
  • WindowsUnpackagedApp - Sample project to demonstrate running Windows targeted WinUI 3 project as Unpackaged app type.
  • PopupDialogs - Sample project to demonstrate the custom dialogs implemented with VijayAnand.MauiToolkit.Pro NuGet package.
  • HybridRclApp - BlazorWebView hybrid sample
    • A hybrid solution demonstrating the capabilities of BlazorWebView control
    • Loaded with .NET MAUI, Windows Forms, WPF, and WinUI 3 projects in a single solution
    • Razor components abstracted in a shared Razor Class Library (RCL)
    • While working with the WinUI 3 Unpackaged model, the below project property needs to be uncommented in the project file otherwise it'll result in the mentioned error message. And for the Packaged model, this can stay as commented or update its value as MSIX (the default value):
<WindowsPackageType>None</WindowsPackageType>

Error message: Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)

Packages

No packages published

Languages

  • C# 96.3%
  • HTML 1.6%
  • CSS 1.4%
  • F# 0.7%