Adding Buttons in Nested ViewModels

Adding Buttons in Nested View Models

There are two ways to create buttons in a nested ViewModel;

  • Using class actions (recommended)
  • Using ViewModel actions

Using Class Action

  1. Add action column in ViewModel.
  2. Go to ViewModel Actions and click Class Action to create New Class Action.
  3. DoubleClick on the created Class Action to open actions editor menu where you can edit class action name and execute expression for action.
  4. Go to the ViewModel and click on the new action column to show its settings on their right where you can link the column to the class action.

Using ViewModel Action

For this option to work action column name must be the same as the ViewModel Action name.

  1. Add action column in ViewModel.
  2. Go to ViewModel Actions and click ViewModel Action to create a new ViewModel Action.
  3. DoubleClick on the created ViewModel Action to open actions editor menu where you can edit ViewModel action name and execute expression for action.
  4. Set a name that will be the same as the name of the action column.
  5. Go back to the ViewModel and click on the new action column to show its settings on their right. Make sure the Name for the column is the same as the one for the new ViewModel action.
Note: Do not link the created ViewModel action to the action column. The button/action column will work automatically and execute the ViewModel action expression.
This page was edited 52 days ago on 07/29/2024. What links here