![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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. |
| | #2 (permalink) |
| 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/ |
| | #3 (permalink) |
| 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/ > > > |
| | #4 (permalink) |
| 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 |
| |
| |
![]() |
| 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 |