PatrickV
PatrickV

Reputation: 2135

Command to Activate New Data Screen linked to Current Screen

I have a List-And-Details screen with a button in the details section. When I click on the button, I want to navigate to a New Data Screen to create an order but have that order tied to the customer displayed in the details screen where the button was clicked. What is the best way to do this?

Upvotes: 1

Views: 412

Answers (1)

Bryan Hong
Bryan Hong

Reputation: 1483

From what I understand you have two screens: a Customer List screen, and a New Order screen. What I would suggest are the following steps:

  1. Create a customerId property on the New Order screen
  2. Mark the customerId property as a screen parameter
  3. When you click the button and navigate to the New Order screen (ShowNewOrderScreen), pass the id of the selected Customer
  4. On the created event of the New Order screen, process the customerId property.
  5. You can load the customer object, then instantiate and add a new order to it.

Upvotes: 2

Related Questions