![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| 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 | |||