Transfer ot the data from page (C#) onto MainActivity tab

Andrey_VAndrey_V Member ✭✭

At the new page that is the object of Page class I have 2 entries. Then I want to use their text property for transmittion content onto Main Activity tab (Application.Android). For example first entry will be "name' and the second will be "key". I want to transmit name.Text and key.Text in Main Activity to work further with them, maybe turn on WiFi network with this name and this key. I tried plugin namespaces, construct my own class (because fortunately I can see the common classes on Main Activity), but there is no luck with it. What do I do wrong? Can anyone help me with with problem? As I understood I am able to turn on device's services only through main Activity. I can be wrong.

P.S. I'd started learning Xamarin about 2 month ago

Answers

  • BillyLiuBillyLiu Member, Xamarin Team Xamurai

    @Andrey_V

    Do you want to pass the data in PCL project toAndroid project?
    You could try to use MessagingCenter.
    For example, you could use Subscribe() in MainActivity and call Send() to pass the data to MainActivity by a button click or something else.

  • Andrey_VAndrey_V Member ✭✭
    @BillyLiu
    I just want to import the current data from current instruments (like f.e. entry) from c# page I would name it the first part of project onto Main Activity tab in the second part of the project.
    But first I will check your offer and if I will stuck again or it won't be that I'm looking for I leave a new comment
    Thank you
  • Andrey_VAndrey_V Member ✭✭

    @BillyLiu
    I suppose that I have to use Dependency Service

Sign In or Register to comment.