When you right-click in the list box that contains the list of locations, a context-sensitive menu is displayed. The Ribbon has corresponding buttons that allow you to perform the same tasks. The Views:CollectionsTControl control element in the LocationPageEditor.xaml file defines the methods called based on the action taken and properties that you set as follows:

·     SelectedItem. This data-bound property is activated when the user selects an item from the list. This property is tied to the CurrentLocation property in the view model, which is located in the LocationPageEditorViewModel.cs file and used by the CollectionTControl control to pass the item selected when you edit or remove an existing item.

·     AddItemAction. This action is performed when the user clicks the Add Item option from the context-sensitive menu or the corresponding buttons on the Ribbon. There is a data binding to a property in the view model that returns the AddLocationAction object. This object is the AddLocationCallback method, located in the LocationPageEditorViewModel.cs file, and displays the dialog box in the AddEditLocationView.xaml file.

·     EditItemAction. This action is performed when the user clicks the Edit Item option from the context-sensitive menu. There is a data binding to a property in the view model that returns the EditLocationAction object. This object is the EditLocationCallback method, located in the LocationPageEditorViewModel.cs file, and displays the dialog box in the AddEditLocationView.xaml file.

·     RemoveAction. This action is performed when the user clicks the Remove Item option from the context-sensitive menu. There is a data binding to a property in the view model that returns the RemoveAction object. This object is the EditLocationCallback method, located in the LocationPageEditorViewModel.cs file, and shows a message that confirms the deletion of the location.

Related Topics

Review the User Interface Used to Modify the List of Possible Locations