Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
HMI-with-WPF-part-3-Communication-with-multiple-plc/SimpleHmi/Bootstrapper.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 lines (38 sloc)
1.45 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Autofac; | |
using Prism.Autofac; | |
using SimpleHmi.Plc2Service; | |
using SimpleHmi.PlcService; | |
using SimpleHmi.Views; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
namespace SimpleHmi | |
{ | |
class Bootstrapper : AutofacBootstrapper | |
{ | |
protected override DependencyObject CreateShell() | |
{ | |
return Container.Resolve<MainWindow>(); | |
} | |
protected override void InitializeShell() | |
{ | |
Application.Current.MainWindow.Show(); | |
} | |
protected override void ConfigureContainerBuilder(ContainerBuilder builder) | |
{ | |
base.ConfigureContainerBuilder(builder); | |
//builder.RegisterType<S7PlcService>().As<IPlcService>().SingleInstance(); | |
builder.RegisterType<DummyPlcService>().As<IPlcService>().SingleInstance(); | |
builder.RegisterType<DummyPlc2Service>().As<IPlc2Service>().SingleInstance(); | |
//builder.RegisterType<ModbusPlc2Service>().As<IPlc2Service>().SingleInstance(); | |
builder.RegisterTypeForNavigation<Plc1MainPage>("MainPage"); | |
builder.RegisterTypeForNavigation<LeftMenu>("LeftMenu"); | |
builder.RegisterTypeForNavigation<HmiStatusBar>("HmiStatusBar"); | |
builder.RegisterTypeForNavigation<SettingsPage>("SettingsPage"); | |
builder.RegisterTypeForNavigation<Plc2MainPage>("Plc2MainPage"); | |
} | |
} | |
} |