Views are everything users can see and interact with. In DotVVM, views are written in DotHTML, a flavour of HTML.
You can see two obvious differences from plain HTML:
the line starting with
@viewModelis the ViewModel Directive. It tells DotVVM which ViewModel belongs to the page, and
value binding expressions that bind ViewModel properties to specific places in the View:
When the user loads the page, the value of the
Result property will displayed inside the
<p> element. Whenever the value of the property in the viewmodel changes, the text in the page gets updated.
- Add a
<p>element inside the
- Use a value binding to display value of the
Resultproperty inside of the