473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

IsolatedStorageSettings vs different methods

134 100+
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 IsolatedStorageSettings, 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
Feb 14 '12 #1
1 2701
LoanB
62
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.GetVariablesfromClass2();
}
}

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

public string[] GetVariablesfromClass2()
{
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?
Mar 7 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Bruce W...1 | last post by:
I'm a PHP newbie coming from experience with ASP.NET. I want to have a separate PHP file to support each HTML PHP page. This would be the equivalent of an ASP.NET code-behind file but using PHP....
0
by: Michael Rostkowski | last post by:
I posted this in alt.php, but as a reply, so now I'm posting it here for people who might have missed it but still could find it useful. Thanks to Andy Hassall for giving me good information. ...
0
by: Chris Jefferson | last post by:
Now, C++ doesn't actually provide true variable-length templated classes, for example you can't do (as I found recently!) template<class T> class tuple { ... } template<class T, class U>...
1
by: deko | last post by:
This may be an elementary question. The Build error I get is: "...frmMain.cs(964): The type or namespace name 'xdd' could not be found..." I create a dataset when frmMain opens: public...
26
by: Cliff Williams | last post by:
Can someone explain the pros/cons of these different ways of creating a class? // 1 function myclass() { this.foo1 = function() {...} } // 2a
3
by: shari | last post by:
hi guys, i am new to this asp.net programming, i have some problem it goes like this: my requirement is that i have to begin a transaction on one button click and i have to commit or roll back...
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a c# windows application vs2005 with a main section and two public static methods. Anyhow I am using the same variable in the main section as well as the methods but in each case I had...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.