0

At first this feature was working, but all the sudden if I add a Clicked property to -for example- the ToolbarItem, it does want to autocomplete the event handler for the cs file, but when I click enter I get the error in the screenshot.

I have tried to find the answer in various forms, but could not find it, that's why I decided to create this post.

<TabbedPage.ToolbarItems>
        <ToolbarItem Text="Add" Clicked="ToolbarItem_Clicked"/>
    </TabbedPage.ToolbarItems>

Screenshot showing the "New Event Handler" dropdown

Screenshot of the error it gives me after I press enter. "Could not create event handler"

As shown in the screenshot it does not give me any reason as to -why- it can't create the event handler in the xaml.cs file.

It used to work fine so maybe I messed something up. Any help would be appreciated :)

  • These tools sometimes behave a little finickle. It is not that hard to write that method yourself. Just wait until you realize that the code ideally does not belong in the XAML code behind, but should be in a viewmodel using binding. – TheRoadrunner Jan 20 '21 at 19:35
  • @TheRoadrunner Thank you for your answer, I'll do some research on it. I just rebooted, and it's -magically- working again. Probably just VS 2019 for mac being buggy. It was actually part of this udemy course I'm folowing to get started with C# and Xamarin to make cross-platorm apps (https://www.udemy.com/course/complete-xamarin-developer-course-ios-and-android/) – TryingToProgram Jan 20 '21 at 21:30

0 Answers0