How do I access to UI Elements from a separate class? RRS feed

  • Question

  • Hey,

    I want to create a separate class whose methods get properties from certain UI-Elements in the MainPage and work with them. My problem is that they are not listed there.

    Can you please tell me what I have to do to solve that problem?

    Thank you very much!

    Greetings, FunkyPeanut

    Oh yeah - I am coding in C#
    Saturday, November 2, 2013 12:53 PM


  • You can export public properties containing the elements you want to share. C# doesn't allow accessing non-public variables from outside of the class.

    A better design would be to provide properties for the data you need in a data model object rather than the UIElement itself and then databank the element to the model object.

    Sunday, November 3, 2013 2:34 PM