Maui for Android Stepping Through Code inside checkbox code

Haviv Elbsz 2,046 Reputation points
2024-07-06T16:13:35.88+00:00

Hello All. in my app I have a checkbox handler that I want in debug to run to cursor and stepping the code. When I put the cursor in the code and right click and choose the option run to cursor the debugger start build and then the UI in the emulator is showing but when I check the checkbox nothing is done. I expect the debugger to stop at the cursor position I marked. Please how I can do that. I'm using the latest visual studio version in android 34 version. Thank you in advanced.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,180 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 38,756 Reputation points Microsoft Vendor
    2024-07-08T05:57:30.8333333+00:00

    Hello,

    If you need to do single-step debugging of the CheckBox's selection function, you need to set the CheckedChanged event and set a breakpoint for that event.

    For example:

    <CheckBox CheckedChanged="CheckBox_CheckedChanged"/>
    
    private void CheckBox_CheckedChanged(object sender, CheckedChangedEventArgs e)
            {
                Console.WriteLine("CheckedChanged");
            }
    

    For this example, you need to hit the breakpoint in the CheckBox_CheckedChanged method.

    For debugging, you could refer to First look at the Visual Studio Debugger for more detailed information.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments