Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Passing parameter from one Page to another

 
 
Old 04-10-2006   #1 (permalink)
Johann MacDonagh


 
 

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.

My System SpecsSystem Spec
Old 04-10-2006   #2 (permalink)
Drew Marsh


 
 

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/


My System SpecsSystem Spec
Old 04-10-2006   #3 (permalink)
Johann MacDonagh


 
 

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/
>
>
>

My System SpecsSystem Spec
Old 04-10-2006   #4 (permalink)
Drew Marsh


 
 

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


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Invoke-Expression parameter Passing PowerShell
Passing filename as parameter PowerShell
Passing a string array as a parameter from one script to another PowerShell
Function Parameter passing wrong or am I ? PowerShell
Problem with parameter passing? PowerShell


Vista Forums 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 Ltd

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