Forum Visual Studio

In a custom cell xamarin keeps deleting my event handler How do I stop this?

I wanted to have a simple custom cell with a slider in it. I have included an event handler that updates a label when the slider value changes. The problem is every time I build the project the designer file gets recreated without the partial event handler. How can I stop this?


  • GrahamBirdGrahamBird USMember

    I am not sure how relevant this is to what you are doing, since it depends a little on where the issue lies in the code itself, but you need the event handler to be specified outside of the designer code.
    When I have done this kind of thing in the past I have always been able to make the class partial and define the extras in an additional file. This way, although the designer file gets updated, the extras do not get overwritten.

    Hope this helps,

Sign In or Register to comment.