Methods
The methods in the viewmodel can be invoked from the view. We'll use them to implement the add / subtract functionality.
public void Add()
{
Result = ...
}
Note: DotVVM will make an AJAX request to the server, where the method in the viewmodel will be executed and the changes made to the viewmodel will be applied to the page.
Tasks
- Inside the
Add
method, add the value ofDifference
to theResult
property. - Inside the
Subtract
method, subtract the value ofDifference
from theResult
property.
Message | Line | Column | |
---|---|---|---|