Back to Root
We need buttons to call the Load
and Unload
methods.
Even inside a Binding Context that is deep within the hierarchy, you can access the ViewModel using the _root
pseudo-variable:
<dot:Button Click="{command: _root.Unload()}"
Text="Unload" />
There is a number of other binding pseudo-variables such as
_parent
,_collection
or_this
.
Tasks
- Add a
<dot:Button>
outside the<div>
and command-bind itsClick
property to theLoad
method. - Add a
<dot:Button>
that invokes theUnload
method inside the<div>
element. Don't forget to use_root
- theUnload
method is declared in the ViewModel, not in theProfile
class.
Message | Line | Column | |
---|---|---|---|