public SensorSettings() { this.InitializeComponent(); // register IPC clients ServiceProvider serviceProvider = new ServiceCollection() .AddNamedPipeIpcClient <ServiceContractInterfaces>("sensors", pipeName: "pipeinternal") .BuildServiceProvider(); // resolve IPC client factory IIpcClientFactory <ServiceContractInterfaces> clientFactory = serviceProvider .GetRequiredService <IIpcClientFactory <ServiceContractInterfaces> >(); // create client this.client = clientFactory.CreateClient("sensors"); DataContext = new SensorSettingsViewModel(); GetConfiguredSensors(); this._dataGrid = this.FindControl <DataGrid>("Grid"); }
public SensorSettingsPage() { viewModel = new SensorSettingsViewModel(DAL.SensorTriggerAccess, DAL.FaultReportAccess); this.InitializeComponent(); this.DataContext = viewModel; }