Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Passing parameter from one Page to another

Closed Thread
 
Thread Tools Display Modes
Old 04-10-2006   #1 (permalink)
Johann MacDonagh
Guest


 

Passing parameter from one Page to another

I have a base object that has a collection of Accounts. Each Account has a
collection of Transactions.

I have one page, Accounts.xaml, which lists all of the accounts. I want to
be able to click on one, transfer a reference of that class to
Transactions.xaml, and display all the Transactions inside that class.

The base class is actually defined globally in the Application collection,
so I only have one instance in the entire application.

Does anyone have any ideas of how to do this?

Thanks.
Old 04-10-2006   #2 (permalink)
Drew Marsh
Guest


 

Re: Passing parameter from one Page to another

Johann MacDonagh wrote:

> I have a base object that has a collection of Accounts. Each Account
> has a collection of Transactions.
>
> I have one page, Accounts.xaml, which lists all of the accounts. I
> want to be able to click on one, transfer a reference of that class to
> Transactions.xaml, and display all the Transactions inside that class.
>
> The base class is actually defined globally in the Application
> collection, so I only have one instance in the entire application.
>
> Does anyone have any ideas of how to do this?


Check out Application Properties. This SDK entry[1] should answer your questions.

Cheers,
Drew

[1] http://windowssdk.msdn.microsoft.com...asp?frame=true

_________________________
Drew Marsh
Chief Software Architect
Mimeo.com, Inc. - http://www.mimeo.com
Microsoft C# / WPF MVP
Weblog - http://blog.hackedbrain.com/


Old 04-10-2006   #3 (permalink)
Johann MacDonagh
Guest


 

Re: Passing parameter from one Page to another

Well, the instance of the base class (that has all the Accounts, etc...) is
already stored in an Application property. My question is, how do I get the
selected Account from one page to another? Are you saying the best way is to
set an Application property to the selected Account?

"Drew Marsh" wrote:

> Johann MacDonagh wrote:
>
> > I have a base object that has a collection of Accounts. Each Account
> > has a collection of Transactions.
> >
> > I have one page, Accounts.xaml, which lists all of the accounts. I
> > want to be able to click on one, transfer a reference of that class to
> > Transactions.xaml, and display all the Transactions inside that class.
> >
> > The base class is actually defined globally in the Application
> > collection, so I only have one instance in the entire application.
> >
> > Does anyone have any ideas of how to do this?

>
> Check out Application Properties. This SDK entry[1] should answer your questions.
>
> Cheers,
> Drew
>
> [1] http://windowssdk.msdn.microsoft.com...asp?frame=true
>
> _________________________
> Drew Marsh
> Chief Software Architect
> Mimeo.com, Inc. - http://www.mimeo.com
> Microsoft C# / WPF MVP
> Weblog - http://blog.hackedbrain.com/
>
>
>

Old 04-10-2006   #4 (permalink)
Drew Marsh
Guest


 

Re: Passing parameter from one Page to another

Johann MacDonagh wrote:

> Well, the instance of the base class (that has all the Accounts,
> etc...) is already stored in an Application property. My question is,
> how do I get the selected Account from one page to another? Are you
> saying the best way is to set an Application property to the selected
> Account?


Yes, you could store the current Account instance itself in a named property
like "CurrentAccount" before navigating to the page that displays the data.
Then in the page that displays the data you know to pull the account out
from that application property. It's like a contract between pages that the
correct data is available in the properties collection ahead of time. Think
of it like query strings or form data in HTTP requests.

You could probably design your own, more advanced page state management,
but this is what is provided for you by WPF out of the box.

HTH,
Drew


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoke-Expression parameter Passing James PowerShell 4 11-02-2007 03:44 AM
Passing filename as parameter anth PowerShell 3 09-28-2007 10:24 PM
Passing a HashTable object as a parameter to a script Brillig PowerShell 8 02-07-2007 04:45 PM
Function Parameter passing wrong or am I ? joergH PowerShell 4 01-23-2007 05:16 PM
Problem with parameter passing? =?Utf-8?B?TWF0dA==?= PowerShell 3 10-06-2006 04:35 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50