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,_collectionor_this.
Tasks
- Add a
<dot:Button>outside the<div>and command-bind itsClickproperty to theLoadmethod. - Add a
<dot:Button>that invokes theUnloadmethod inside the<div>element. Don't forget to use_root- theUnloadmethod is declared in the ViewModel, not in theProfileclass.
| Message | Line | Column | |
|---|---|---|---|
|
|