diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs | 16 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs index f4bbf6da3..523934985 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs @@ -227,6 +227,13 @@ namespace Tango.PPC.MachineSettings.ViewModels set { _lubricationLevels = value; RaisePropertyChangedAuto(); } } + private RmlLubricationLevelSettings _selectedLubricationLevel; + public RmlLubricationLevelSettings SelectedLubricationLevel + { + get { return _selectedLubricationLevel; } + set { _selectedLubricationLevel = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -445,6 +452,15 @@ namespace Tango.PPC.MachineSettings.ViewModels } LubricationLevels = levels; + + if (SelectedLubricationLevel != null) + { + SelectedLubricationLevel = LubricationLevels.FirstOrDefault(x => x.RmlGuid == SelectedLubricationLevel.RmlGuid); + } + else + { + SelectedLubricationLevel = LubricationLevels.FirstOrDefault(); + } } catch (Exception ex) { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index d105278e6..e69c57753 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -176,7 +176,7 @@ <StackPanel Margin="20 0 20 40"> <StackPanel Margin="0 40 0 0"> <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">Thread Type</TextBlock> - <touch:TouchComboBox x:Name="lubricationCombo" Margin="0 5 0 0" ItemsSource="{Binding LubricationLevels}" DisplayMemberPath="Name"></touch:TouchComboBox> + <touch:TouchComboBox x:Name="lubricationCombo" Margin="0 5 0 0" ItemsSource="{Binding LubricationLevels}" SelectedItem="{Binding SelectedLubricationLevel}" DisplayMemberPath="Name"></touch:TouchComboBox> </StackPanel> <StackPanel Margin="0 20 0 0"> |
