Setting up a conditional breakpoint is really easy.
Press F9 in your code to set a breakpoint on a particular line:
Then right-click on the breakpoint “red circle” on the left
of the editor and select the “Condition…” context menu:
This will bring up a dialog that allows you indicate that
the breakpoint should only be hit if some condition is true. For example,
we could indicate that we only want to break in the debugger if the size of the
local paginatedDinners list is less than 10 by writing the code expression
below:
Now when I re-run the application and do a search, the
debugger will only break if I perform a search that returns less than 10
dinners. If there are more than 10 dinners then the breakpoint won’t be
hit.