aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-02-20 11:39:04 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-02-20 11:39:04 +0200
commit57a828b4d11ab8274053ee035c8de8014ddd4ca1 (patch)
treec88e63b5e9019fe67cc3be451e46fbe57efc4a35 /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
parent2d55102532afaccc447c8a28ded8ccb93437683b (diff)
parentd6e2772dd98e6880de14ea12be0ef53bae24f763 (diff)
downloadTango-57a828b4d11ab8274053ee035c8de8014ddd4ca1.tar.gz
Tango-57a828b4d11ab8274053ee035c8de8014ddd4ca1.zip
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs27
1 files changed, 24 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
index 5e5370416..5c4d003a1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/ThreadLoadingViewVM.cs
@@ -40,6 +40,13 @@ namespace Tango.PPC.UI.Dialogs
set { _isFinalizing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
}
+ private bool _isPreparing;
+ public bool IsPreparing
+ {
+ get { return _isPreparing; }
+ set { _isPreparing = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
+ }
+
public List<Rml> Rmls { get; set; }
private Rml _selectedRml;
@@ -51,15 +58,28 @@ namespace Tango.PPC.UI.Dialogs
public RelayCommand ContinueCommand { get; set; }
- public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs)
+ public ThreadLoadingViewVM(IMachineProvider machineProvider)
{
CanClose = true;
- _confirmationArgs = confirmationArgs;
+ IsPreparing = true;
ContinueCommand = new RelayCommand(ContinueThreadLoading, () => !IsFinalizing && SelectedRml != null);
MachineProvider = machineProvider;
MachineProvider.MachineOperator.ThreadLoadingStatusChanged += MachineOperator_ThreadLoadingStatusChanged;
MachineProvider.MachineOperator.ThreadLoadingCompleted += MachineOperator_ThreadLoadingCompleted;
MachineProvider.MachineOperator.ThreadLoadingFailed += MachineOperator_ThreadLoadingFailed;
+ MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired += MachineOperator_ThreadLoadingConfirmationRequired;
+ }
+
+ public ThreadLoadingViewVM(IMachineProvider machineProvider, ThreadLoadingConfirmationRequiredEventArgs confirmationArgs) : this(machineProvider)
+ {
+ _confirmationArgs = confirmationArgs;
+ IsPreparing = false;
+ }
+
+ private void MachineOperator_ThreadLoadingConfirmationRequired(object sender, ThreadLoadingConfirmationRequiredEventArgs e)
+ {
+ _confirmationArgs = e;
+ IsPreparing = false;
}
private async void ContinueThreadLoading()
@@ -125,7 +145,7 @@ namespace Tango.PPC.UI.Dialogs
{
Status = e;
- if(Status.State == ThreadLoadingState.Finalizing)
+ if (Status.State == ThreadLoadingState.Finalizing)
{
IsFinalizing = true;
}
@@ -150,6 +170,7 @@ namespace Tango.PPC.UI.Dialogs
MachineProvider.MachineOperator.ThreadLoadingStatusChanged -= MachineOperator_ThreadLoadingStatusChanged;
MachineProvider.MachineOperator.ThreadLoadingCompleted -= MachineOperator_ThreadLoadingCompleted;
MachineProvider.MachineOperator.ThreadLoadingFailed -= MachineOperator_ThreadLoadingFailed;
+ MachineProvider.MachineOperator.ThreadLoadingConfirmationRequired -= MachineOperator_ThreadLoadingConfirmationRequired;
}
}
}