public InstructionDetailsViewModel(Instruction instruction = null) { SelectZoneCommand = new RelayCommand(OnSelectZoneCommand, CanSelect); SelectDeviceCommand = new RelayCommand(OnSelectDeviceCommand, CanSelect); if (instruction != null) { Title = "Редактирование инструкции"; Instruction = instruction; CopyProperties(); } else { Title = "Новая инструкция"; Instruction = new Instruction(); CopyProperties(); } }
public InstructionDetailsViewModel(Instruction instruction = null) { SelectZoneCommand = new RelayCommand(OnSelectZoneCommand, CanSelect); SelectDeviceCommand = new RelayCommand(OnSelectDeviceCommand, CanSelect); if (instruction != null) { Title = "Редактирование инструкции"; Instruction = instruction; CopyProperties(); } else { Title = "Новая инструкция"; Instruction = new Instruction(); CopyProperties(); if (FiresecManager.SystemConfiguration.Instructions.IsNotNullOrEmpty()) InstructionNo = FiresecManager.SystemConfiguration.Instructions.Select(x => x.No).Max() + 1; } }
public InstructionViewModel(Instruction instruction) { Instruction = instruction; }