How can I change access level of fields generated by GUI designer? RRS feed

  • Question

  • User118116 posted

    Hi everybody, When I make new window in designer and a TreeView in it, it will be private. I want to use it from an other class, so I would like to change it to internal or public, but I couldn't find how to make that. I'm a beginner in using Xamarin Studio...

    Thanks for any help.

    Tuesday, March 31, 2015 12:49 PM


  • User1148 posted

    The supported way of doing this is to remove the property from the .designer.cs file and place it in the main .cs file. Then remove the [DesignerGenerated] attribute from the declaration.

    The code generation in the designer will recognise that the [Outlet] exists in the actual .cs file and will not place one in the .designer.cs file. Once you do this, you can add the public/internal modifiers as you want

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, April 1, 2015 5:06 PM