Skip to main content

How to integrate Grial into an existing .NET MAUI project

  1. Make sure that the namespace in Grial Web Admin matches your project's namespace.

  2. Add latest UXDivers.GrialMaui nuget package.

  3. Set the ApplicationTitle and ApplicationId in the .csproj file that matches the ones defined in Grial Web Admin.

  4. Include the GrialLicense file as an EmbeddedResource in the project root.

  5. In Android's MainActivity.OnConfigurationChanged method add this line: GrialKit.NotifyConfigurationChanged(newConfig);

  6. In Android's MainApplication.CreateMauiApp method add this line: GrialKit.Init("<ROOT_NAMESPACE>.GrialLicense");

  7. In iOS's AppDelegate.CreateMauiApp method add this code (using your accent color):

    var theme = new ThemeColorsBase(new Dictionary<string, Color> {{ "AccentColor", Color.FromArgb("#FF3F75FF") }});
    GrialKit.Init(theme, "<ROOT_NAMESPACE>.GrialLicense");
  8. Copy the App.xaml styles to your App.xaml.

  9. Copy Controls, Helpers, Resx, Themes and Styles folders.

  10. Include the reference to the selected Theme in the MergedDictionaries of the App.xaml.

  11. Add this line to the App constructor: Resources["DefaultStringResources"] = new Resx.AppResources();

  12. Copy Resources/Fonts folder and check that fonts build action is set to MauiFont.

  13. Restore packages and run the project.