Skip to content

Commit

Permalink
fix: BreakPoint enable/disable from UI
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilien-noal committed Dec 9, 2024
1 parent 5a7a235 commit 18c488e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Spice86/ViewModels/BreakpointViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public BreakpointViewModel(EmulatorBreakpointsManager emulatorBreakpointsManager
_emulatorBreakpointsManager = emulatorBreakpointsManager;
IsEnabled = true;
Address = breakPoint.Address;
Enable();
}

public BreakPointType Type => _breakPoint.BreakPointType;
Expand Down
1 change: 0 additions & 1 deletion src/Spice86/ViewModels/BreakpointsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ internal void AddAddressBreakpoint(AddressBreakPoint addressBreakPoint) {
var breakpointViewModel = new BreakpointViewModel( _emulatorBreakpointsManager, addressBreakPoint);
Breakpoints.Add(breakpointViewModel);
SelectedBreakpoint = breakpointViewModel;
SelectedBreakpoint.Enable();
}

private bool RemoveBreakpointCanExecute() => SelectedBreakpoint is not null;
Expand Down
4 changes: 2 additions & 2 deletions src/Spice86/ViewModels/DisassemblyViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ private void DisableBreakpoint() {
if (SelectedInstruction?.Breakpoint is null) {
return;
}
SelectedInstruction.Breakpoint.IsEnabled = false;
SelectedInstruction.Breakpoint.Disable();
}

[RelayCommand(CanExecute = nameof(SelectedInstructionHasBreakpoint))]
private void EnableBreakpoint() {
if (SelectedInstruction?.Breakpoint is null) {
return;
}
SelectedInstruction.Breakpoint.IsEnabled = false;
SelectedInstruction.Breakpoint.Enable();
}


Expand Down

0 comments on commit 18c488e

Please sign in to comment.