diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-06 19:17:12 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-06 19:17:12 +0300 |
| commit | 6372938441d1cbf19ed8c7b87ee46019c55af5db (patch) | |
| tree | 4500e182daaa5b13ddc97d8ec8c66ae0305c4b43 /Software/Visual_Studio/Utilities/Tango.MachineEM.UI | |
| parent | 3060ea33084605b991ba924d8ace97c035c7ba89 (diff) | |
| download | Tango-6372938441d1cbf19ed8c7b87ee46019c55af5db.tar.gz Tango-6372938441d1cbf19ed8c7b87ee46019c55af5db.zip | |
Improved handling for job aborted by embedded.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineEM.UI')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs | 6 | ||||
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs index f42e7f161..62a05472d 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/ViewModels/MainViewVM.cs @@ -112,6 +112,11 @@ namespace Tango.MachineEM.UI.ViewModels /// </summary> public RelayCommand FinalizeThreadLoadingCommand { get; set; } + /// <summary> + /// Gets or sets the abort job. + /// </summary> + public RelayCommand AbortJobCommand { get; set; } + #endregion #region Constructors @@ -144,6 +149,7 @@ namespace Tango.MachineEM.UI.ViewModels ValidateCartridgeCommand = new RelayCommand(ValidateCartridge, (x) => Emulator.IsStarted); StartThreadLoadingCommand = new RelayCommand(StartThreadLoading, (x) => Emulator.IsStarted && !_isThreadLoading); FinalizeThreadLoadingCommand = new RelayCommand(FinalizeThreadLoading, (x) => Emulator.IsStarted && _isThreadLoading); + AbortJobCommand = new RelayCommand(() => Emulator?.AbortJob(), (x) => Emulator.IsStarted); Ports = new List<string>() { diff --git a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml index 4dad04d28..6ebd1cde2 100644 --- a/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/Views/MainView.xaml @@ -135,6 +135,13 @@ </Border> </Popup> <!--BUTTONS HERE--> + + <Button Padding="10 0 0 0" Margin="5" Height="45" HorizontalContentAlignment="Left" Style="{StaticResource AccentedSquareButtonStyle}" mahapps:ButtonHelper.PreserveTextCase="True" BorderThickness="0" Command="{Binding AbortJobCommand}"> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Icon="ExclamationTriangle" Width="16"></fa:ImageAwesome> + <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">ABORT JOB</TextBlock> + </StackPanel> + </Button> </StackPanel> </Grid> <TextBox x:Name="txtLog" Grid.Column="1" FontFamily="monospaced" TextChanged="txtLog_TextChanged" Text="{Binding Log}" Background="Transparent" Foreground="Red" FontSize="11" Padding="5" Style="{x:Null}" BorderThickness="0" IsReadOnly="True" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap"> |
