aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-08-02 11:59:16 +0300
committerAvi Levkovich <avi@twine-s.com>2018-08-02 11:59:16 +0300
commitf4b51ad784cffc3493f32a9b4f1e9afc6fd2a43c (patch)
tree1471983c9cfce00b4a0c6b26f6c3c0429405c904 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels
parentda3ed099835ff1dd9b21cdd590e252360df2312d (diff)
parent66aa9beeec79e5f828fc13ce7a5e41c15227ec9a (diff)
downloadTango-f4b51ad784cffc3493f32a9b4f1e9afc6fd2a43c.tar.gz
Tango-f4b51ad784cffc3493f32a9b4f1e9afc6fd2a43c.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs27
1 files changed, 22 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index a58757633..569359066 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -180,8 +180,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
if (_selectedMachine != null)
{
- _selectedMachine.Saved -= SelectedMachine_Saved;
- _selectedMachine.Saved += SelectedMachine_Saved;
+ _selectedMachine.Modified -= SelectedMachine_Modified;
+ _selectedMachine.Modified += SelectedMachine_Modified;
}
}
}
@@ -627,6 +627,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// Gets or sets the display job embroidery file command.
/// </summary>
public RelayCommand<Job> DisplayJobEmbroideryFileCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the reload machines command.
+ /// </summary>
+ public RelayCommand ReloadMachinesCommand { get; set; }
#endregion
#region Constructors
@@ -703,6 +708,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
PushProcessParametersCommand = new RelayCommand(PushProcessParameters, () => SelectedRML != null && SelectedRML.ProcessParametersTablesGroups.Count > 0 && SelectedProcessParametersTable != null && MachineOperator != null);
ImportEmbroideryFileCommand = new RelayCommand(ImportEmbroideryFile, () => SelectedMachine != null);
DisplayJobEmbroideryFileCommand = new RelayCommand<Job>(DisplayJobEmbroideryFile);
+ ReloadMachinesCommand = new RelayCommand(ReloadMachine);
ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged;
@@ -850,10 +856,21 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
- private void SelectedMachine_Saved(object sender, EventArgs e)
+ private void SelectedMachine_Modified(object sender, ObservableModifiedEventArgs e)
{
- InvalidateLiquidFactorsAndProcessTables();
- SelectedMachine.Reload(_machineDbContext);
+ if (e.IsOtherContext)
+ {
+ InvokeUI(() =>
+ {
+ SelectedMachine.Reload(_machineDbContext);
+ InvalidateLiquidFactorsAndProcessTables();
+
+ if (SelectedSegment != null)
+ {
+ OnSelectedSegmentChanged();
+ }
+ });
+ }
}
/// <summary>