Skip to content

Common libraries for reusable components in the frame of Digital Engineering Hub

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

STARIONGROUP/DEH-Common

DEHP-Common

Common libraries for reusable components in the frame of Digital Engineering Hub Pathfinder

Build status

AppVeyor is used to build and test the C# DEHP-Common

Branch Build Status
Master Build Status
Development Build status

Build history

SonarQube Status:

Quality Gate Status Maintainability Rating Reliability Rating Security Rating

Coverage Duplicated Lines (%)

Bugs Lines of Code Technical Debt Vulnerabilities

Usage:

IoC:

DEHP Common library has an Inversion of Control Container implementation based on Autofac.

The container is located under DEHPCommon.AppContainer.Container;

It is necessary to build the DEHP IoC container before using DEHPCommon

public App(ContainerBuilder containerBuilder = null)
{
    containerBuilder ??= new ContainerBuilder();
    //Registering the DST adapter specifics dependencies
    containerBuilder.RegisterType<MainWindowViewModel>().As<IMainWindowViewModel>().SingleInstance();
    //Building the Container 
    DEHPCommon.AppContainer.BuildContainer(containerBuilder);
}

Navigation:

DEHP Common library provides a way to resolve Data Context of views by resolving automatically the view model and its dependencies. The service is called INavigationService and is registered in the IoC container.

void Show<TView>() where TView : Window, new();

Usage of the previous method relies on the naming convention of the ViewModel:

class MyView; class MyViewViewModel

Otherwise the use of the following overload is necessary:

void Show<TView, TViewModel>(TViewModel viewModel = null) where TView : Window, new() where TViewModel : class;

Example of usage:

protected override void OnStartup(StartupEventArgs e)
{
    //Using the container
    using (var scope = DEHPCommon.AppContainer.Container.BeginLifetimeScope())
    {
        scope.Resolve<INavigationService>().Show<MainWindow>();
    }

    base.OnStartup(e);
}

About

Common libraries for reusable components in the frame of Digital Engineering Hub

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Code of conduct

Stars

Watchers

Forks

Packages