diff options
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogViewVM.cs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogViewVM.cs index 0026a47ff..bb2209101 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogViewVM.cs @@ -10,6 +10,9 @@ namespace Tango.FSE.UI.Dialogs { public class EmulateMachineEventDialogViewVM : FSEDialogViewVM { + private static EmulateMachineEventDialogViewVM _lastInstance; + + public List<EventType> EventTypes { get; set; } private EventType _selectedEventType; @@ -26,7 +29,12 @@ namespace Tango.FSE.UI.Dialogs set { _durationSeconds = value; RaisePropertyChangedAuto(); } } - public String Message { get; set; } + private String _message; + public String Message + { + get { return _message; } + set { _message = value; RaisePropertyChangedAuto(); } + } public EmulateMachineEventDialogViewVM() { @@ -38,5 +46,23 @@ namespace Tango.FSE.UI.Dialogs { return base.CanOK() && SelectedEventType != null && DurationSeconds > 0; } + + protected override void Accept() + { + _lastInstance = this; + base.Accept(); + } + + public override void OnShow() + { + base.OnShow(); + + if (_lastInstance != null) + { + SelectedEventType = EventTypes.FirstOrDefault(x => x.Code == _lastInstance.SelectedEventType.Code); + DurationSeconds = _lastInstance.DurationSeconds; + Message = _lastInstance.Message; + } + } } } |
