D
D
DraculaDIS2012-08-07 16:24:20
Microsoft Silverlight
DraculaDIS, 2012-08-07 16:24:20

Experience using MVVM on Windows 8/Windows Phone?

Interested in navigation between pages.
For example: a page with a list of elements, by tapping on an element, you need to go to the detailed view of the element loaded by the first ID ...
Option one: Implement ICommand in the first model, the command loads what is needed, creates a new model for the detailed view and displays it on the second page (complexity - transferring the detailed view model between pages)
Option two: Tapu navigates to a new page with a parameter in the form of a model identifier, OnNavigatedTo on the second page, we load the data and throw it into the page context. (complexity - you need to write code in the page itself, i.e. we associate the View Model with the view)
Option three: By tapu, we immediately go to a new page, somehow find the first model in the page code, and call the data loading method in it.
How will everything be beautiful and right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VashS, 2012-08-07
@VashS

Depending on what you use… MVVMLight has Messenger for data transfer.
The first one is better, IMHO.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question