Requesting Guidance on Referencing a Method in .NET MAUI within Visual Studio 2022

Sarfaraz Sable 30 Reputation points
2024-01-05T07:24:25.75+00:00

I'm currently working with .NET MAUI in Visual Studio 2022 and have encountered an issue while attempting to reference a method I created within my code. The method is intended to be invoked upon clicking a button. However, I'm facing difficulties enabling the reference to this method.

Could you kindly provide guidance on how to properly enable and display the reference to this method when it's called within the code?

   private async void OnSaveButtonClicked(object sender, EventArgs e)
   {}  code 

<Button Text="Save" Clicked="OnSaveButtonClicked" HorizontalOptions="End" VerticalOptions="Center" /> -UI

User's image

Your assistance in resolving this matter would be greatly appreciated.

Developer technologies | .NET | .NET MAUI
Developer technologies | Visual Studio | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2024-01-08T09:02:28.6266667+00:00

    Hello,

    The "References" doesn't show the reference number from the .xaml. Please see Find code changes and other history with CodeLens - Visual Studio (Windows) | Microsoft Learn

    If the indicator shows 0 references, you don't have any references from your C# or Visual Basic code. However, there might be references in other items such as .xaml and .aspx files.

    (Also, I added a VS tag for this thread since the issue is related to IDE)

    Best Regards,

    Wenyan Zhang


    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.