aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-05-29 15:57:53 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-05-29 15:57:53 +0300
commitc3b117cb5612295c80e1ed3da1cc10a582d5cb9f (patch)
tree0b14d3c844e87795cc8dbde8896164266d6562ef /Software/Visual_Studio/PPC/Tango.PPC.UI
parentbfd64387ce0d2584bfcf2f5b31980395625634fe (diff)
downloadTango-c3b117cb5612295c80e1ed3da1cc10a582d5cb9f.tar.gz
Tango-c3b117cb5612295c80e1ed3da1cc10a582d5cb9f.zip
PPC. Bug error GoTOJob when job is null.
Related Work Items: #8486
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml26
2 files changed, 31 insertions, 3 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
index 1182ba50e..68c0f1867 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
@@ -45,6 +45,7 @@ namespace Tango.PPC.UI.ViewModels
if (_job == null)
IsDyeingProcess = false;
RaisePropertyChangedAuto();
+ InvalidateRelayCommands();
}
}
@@ -243,7 +244,7 @@ namespace Tango.PPC.UI.ViewModels
StopCommand = new RelayCommand(StopJob, () => CanStopped());
AbortCommand = new RelayCommand(AbortJob, () => CanStopped());
- GoToJobCommand = new RelayCommand(GoToJob);
+ GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob());
JobStatusViewCommand = new RelayCommand(JobStatusView);
OverviewViewCommand = new RelayCommand(OverviewView);
ClearAllNotificationsCommand = new RelayCommand(ClearAllNotifications);
@@ -467,6 +468,11 @@ namespace Tango.PPC.UI.ViewModels
#region Methods
+ private bool IsEnableGoToJob()
+ {
+ return Job != null && _handler != null;
+ }
+
private void GoToJob()
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
index 8baaf0067..731693a06 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -335,8 +335,30 @@
<DockPanel>
<touch:TouchButton Command="{Binding GoToJobCommand}" DockPanel.Dock="Right" VerticalAlignment="Top" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">
<StackPanel Orientation="Vertical">
- <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom">Go To Job</TextBlock>
- <Rectangle Height="3" Fill="{StaticResource TangoPrimaryAccentBrush}" VerticalAlignment="Bottom" Margin="0 2 0 0"></Rectangle>
+ <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom" Text="Go To Job">
+ <TextBlock.Style>
+ <Style TargetType="{x:Type TextBlock}">
+ <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsEnabled}" Value="False">
+ <Setter Property="Foreground" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ <Rectangle Height="3" VerticalAlignment="Bottom" Margin="0 2 0 0">
+ <Rectangle.Style>
+ <Style TargetType="{x:Type Rectangle}">
+ <Setter Property="Fill" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsEnabled}" Value="False">
+ <Setter Property="Fill" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Rectangle.Style>
+ </Rectangle>
</StackPanel>
</touch:TouchButton>
<touch:TouchButton DockPanel.Dock="Right" Visibility="{Binding ApplicationManager.IsInTechnicianMode,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Top" Margin="0 0 20 0" Command="{Binding DisplayJobOutlineCommand}" Style="{StaticResource TangoLinkButton}" FontSize="{StaticResource TangoTitleFontSize}">