public void SetEntity(IModbusMemoryEntityViewModel modbusMemoryEntityViewModelToEdit)
 {
     this.ModbusMemoryEntityViewModelToEdit = modbusMemoryEntityViewModelToEdit;
     this.RaisePropertyChanged(nameof(this.ModbusMemoryEntityViewModelToEdit));
     this.ValueDec = this.ModbusMemoryEntityViewModelToEdit.DirectValueDec;
     this.ValueHex = this.ModbusMemoryEntityViewModelToEdit.DirectValueHex;
     this.RaisePropertyChanged(nameof(this.ModbusMemoryEntityViewModelToEdit.AdressDec));
     this.RaisePropertyChanged(nameof(this.ModbusMemoryEntityViewModelToEdit.AdressHex));
     this._resultedValueUshort = ushort.Parse(this.ModbusMemoryEntityViewModelToEdit.DirectValueDec);
 }
Exemplo n.º 2
0
        private async void OnExecuteEditEntity(IModbusMemoryEntityViewModel modbusMemoryEntityViewModel)
        {
            IModbusEntityEditingViewModel modbusEntityEditingViewModel =
                _container.Resolve <IModbusEntityEditingViewModel>();

            modbusEntityEditingViewModel.DataProviderContainer = DeviceContext.DataProviderContainer;
            modbusEntityEditingViewModel.SetEntity(modbusMemoryEntityViewModel.Clone() as IModbusMemoryEntityViewModel);
            _applicationGlobalCommands.ShowWindowModal(() => new ModbusEntityEditingView(),
                                                       modbusEntityEditingViewModel);
            if (!IsQueriesStarted)
            {
                await OnExecuteOneQuery();
            }
        }