Forum Xamarin.Forms

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Not sure what you're using for obfuscation but most tools have a way of adding an attribute to a method to keep it from being obfustated.

    [DoNotObfuscate]
    public void myMethod... 
    

    Or something similar. Check the documentation for your obfuscation tool.

    Alternatively, if you want the method to continue to be obfuscated...
    Stop using button.click - its a bad practice anyway.
    Wire up a proper ICommand.

  • ChaseFlorellChaseFlorell CAInsider, University mod

    In the MS Docs, there's an ObfuscationAttribute that you can access

    [ObfuscationAttribute(Exclude=true)]
    void OnButtonClick(object sender, EventArgs e)
    {
       //some logic.
    }
    
  • ravindar26ravindar26 INMember

    @ClintStLaurent said:
    Not sure what you're using for obfuscation but most tools have a way of adding an attribute to a method to keep it from being obfustated.

    [DoNotObfuscate]
    public void myMethod... 
    

    Or something similar. Check the documentation for your obfuscation tool.

    Alternatively, if you want the method to continue to be obfuscated...
    Stop using button.click - its a bad practice anyway.
    Wire up a proper ICommand.

    @ChaseFlorell said:
    In the [MS Docs][1], there's an ObfuscationAttribute that you can access

    [ObfuscationAttribute(Exclude=true)]
    void OnButtonClick(object sender, EventArgs e)
    {
       //some logic.
    }
    

    [1]: https://msdn.microsoft.com/en-us/library/system.reflection.obfuscationattribute(v=vs.110).aspx

    @ChaseFlorell
    Thats a good option. ( ObfuscationAttribute). but, thats not available for PCL .
    I'm able to use it in Android Project but not for PCL.
    Thanks :smile:

    @ClintStLaurent
    +1 for ICommand..
    Thanks :smile:

Sign In or Register to comment.