IsolatedStorageSettings vs different methods

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michaeldebruin
    New Member
    • Feb 2011
    • 134

    IsolatedStorageSettings vs different methods

    Hello all,

    I am trying to create Windows Phone application. But I need to retrieve values from variables between the different classes. For example: I need to get the value of a variable from class2 in class1. Anyone got any ideas what's the fastest and safest way to do this?

    I know I will be able to do this by using the IsolatedStorage Settings, but I don't know if it is the fastest/safest way to do the thing I want.

    Any tips or help will be appreciated.

    Thanks in Advance,

    Michael
  • LoanB
    New Member
    • Nov 2007
    • 62

    #2
    Hi Sorry I do not have much background on what you are trying to do but can you not do something like this:

    public class Class1
    {
    public string CustomerName { get; set; }

    public Class1()
    {
    Class2 c2 = new Class2();
    CustomerName = c2.GetVariables fromClass2();
    }
    }

    public class Class2
    {
    private string FirstName = "Joe";
    private string LastName = "Doe";

    public string[] GetVariablesfro mClass2()
    {
    return new string[] { FirstName, LastName };
    }
    }

    Or..

    Why not have a intermediary static class with static properties and have Class2 set those properties and class one read them?

    Comment

    Working...