locked
VS2017 Cross Platform Xamarin Forms Development and Passing Data RRS feed

  • Question

  • User370019 posted

    I have a cross platform application I am working on which each device platform connects to a WCF service to get specific information from a database. We only want our service connecting to the database, not the apps. This information needs to be passed to the UI's (xaml) and I am having a hard time with it. So I have 5 projects

    Apps (Shared) Apps.Android Apps.IOS Apps.WCFService Apps.UMP

    Most of my work is done in the Android project now and the Service project. As of right now everything is working fine and I can call on my service from the Android project and get requested information. I have all the data in the MainActivity class in the Android project. So at this point, I need to send the data to the xaml pages in the Shared xaml files in order to add to controls and display to users.

    I am not finding a way to do this yet. Any help would be appreciated.

    Wednesday, June 20, 2018 9:44 PM

Answers

  • User370019 posted

    Got it working, thanks. Used a DependecyService to get data from a specific device project to the Xamarin Forms shared project.. I will be using MessagingCenter to pass data between Xamarin Forms

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, June 21, 2018 8:35 PM

All replies

  • User355640 posted

    I have all the data in the MainActivity class in the Android project. So at this point, I need to send the data to the xaml pages in the Shared xaml files in order to add to controls and display to users

    You can use MessagingCenter. With the MessagingCenter, you can send the data from Android platform and receive the data in PCL's page( PCL is your "Apps (Shared)" ). And here is a blog about how to use it.

    Thursday, June 21, 2018 1:49 AM
  • User370019 posted

    Got it working, thanks. Used a DependecyService to get data from a specific device project to the Xamarin Forms shared project.. I will be using MessagingCenter to pass data between Xamarin Forms

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, June 21, 2018 8:35 PM