locked
Sharing custom data from one app to another app

    Question

  • Hello everyone.

    After seeing demo of File and data sharing in windows phone 8.1 runtime.I am trying to send one custom data object from one app to anothe app.

    Class InformationClass

    {

    int id;

    string name;

    }

    InformationClass is custom class and i want to transfer this class object to another application via DataTransferManager.

    May be like this ..

    InformationClass obj = new InformationClass();

    obj.id=1;

    obj.name="test";

    Now i want to send obj Object from one app to another app.

    Referred link :

    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh871368.aspx


    Friday, August 01, 2014 10:20 AM

All replies

  • There are sample links at the bottom of that page you posted:


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, August 01, 2014 12:29 PM
    Moderator
  • Hey i go through detail about it but when i tried with my object structure (InformationClass) then it will give me exception.

    referenced code.

    void dataTransfer_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
            {
                try
                {
                    DataRequest request = args.Request;
                    InformationClass data = new InformationClass();
                    data.id = "1";
                    data.Text = SearchTerm.Text;

                    DataPackage dp = new DataPackage();
                    dp.SetData("infoData", data);
                    

                }
                catch (Exception ex)
                {
                    string errorMessage = ex.Message;
                }
            }

    Monday, August 04, 2014 12:31 PM