You can just instantiate a view model in a unit test and test away.
Sie können einfach ein Ansichtsmodell in einem Komponententest initiieren und mit dem Testen beginnen.
So you need another completely distinct object model: the view model for the presentation.
Daher ist ein weiteres vollkommen distinktes Objektmodell erforderlich: das Ansichtsmodell für die Darstellung.
To build an administrative status interface, I add a Nancy module and map a status route to render a status view, passing the pending message count as the view model: XML Copy
Für die Entwicklung einer administrative Statusschnittstelle füge ich ein Nancy-Modul hinzu und ordne eine Statusroute zu, die eine Statusansicht rendert. Sie gibt die Anzahl der ausstehenden Nachrichten an das Anzeigemodell weiter
This is tied to a view model that's in a class named Edit.js.
Diese ist an ein Anzeigemodell gebunden, das sich in einer Klasse mit dem Namen „Edit.js" befindet.
Latter will be a real problem if you use the same service for different applications like your CMS which also shows posts, but maybe with a different view model, than your web page.
Dies stellt auch ein echtes Problem dar wenn die selbe Persistenzschicht auch in anderen Applikationen Verwendung findet, zum Beispiel in einem CMS, welches ebenfalls Posts anzeigen kann, aber eventuell mit einem anderen View-Modell als Ihre Webseite.
If street furniture positions have been designed in your civil design application through the use of a series of point strings, it is possible to automatically place these items in your Civil View model.
Wenn in Ihrer Civil Design-Anwendung mit einer Reihe von Punktzeichenfolgen Positionen mit Straßenausrüstungen erstellt wurden, können diese Elemente automatisch in Ihr Civil View-Modell platziert werden.
However, if I create a helper method to create that new instance of the view model, I only have to make the change in one place.
Wenn ich jedoch eine Hilfsmethode zum Erstellen der neuen Instanz des Ansichtsmodells erstelle, muss ich die Änderung nur an einer Stelle vornehmen.
The view model creates a continuation chain that runs some tasks on the main thread and some tasks in the background.
Das Ansichtsmodell erstellt eine Fortsetzungskette zur Ausführung einiger Aufgaben im Hauptthread und einiger Aufgaben im Hintergrund.
Here I'm setting the results, a single object, to the ninja property of the current view model.
Hier lege ich die Ergebnisse, ein einzelnes Objekt, auf die Eigenschaft „ninja" des aktuellen Anzeigemodells fest.
In the ninjas.js class I bound the results to a ninjas array property of my view model.
In der Klasse „ninjas.js" habe ich die Ergebnisse an eine Arrayeigenschaft „ninjas" meines Anzeigemodells gebunden.
View models are likely to change over time, which may involve different things being injected into the view model, which means different constructor parameters.
Es ist sehr wahrscheinlich, dass sich Ansichtsmodelle im Laufe der Zeit ändern. Dabei werden möglicherweise verschiedene Objekte in das Ansichtsmodell eingefügt, was verschiedene Konstruktorparameter bedeutet.
The response now includes the list of Ninjas and I set that to the ninjas array of my view model, which gets returned to the ninjas.html page that triggered the request.
Die Antwort enthält jetzt die Ninja-Liste, und diese wurde auf das Ninja-Array des Anzeigemodells festgelegt, das an die ninjas.html-Seite zurückgegeben wird, von der die Anforderung ausgelöst wurde.
Set focus on textbox in WPF from view model (C#)
Legen Sie den Fokus auf Textfeld in WPF aus Ansichtsmodell (C ) fest