Пример #1
0
        protected override void ExecuteAction(ObjectBuilderContext context, BaseItemAction action, dynamic metadata)
        {
            var selectedItem = action.GetSelectedItem();

            if (selectedItem != null)
            {
                ViewHelper.ShowView(selectedItem,
                                    () => context.Build(action.GetView(), metadata.View),
                                    childDataSource => OnInitializeChildView(childDataSource, selectedItem),
                                    childDataSource => OnAcceptedChildView(action, childDataSource, selectedItem));
            }
        }
Пример #2
0
        protected override void ExecuteAction(ObjectBuilderContext context, BaseItemAction action, dynamic metadata)
        {
            var selectedItem = action.GetSelectedItem();

            if (selectedItem != null && (Convert.ToBoolean(metadata.Accept) == false
                                         ||
                                         MessageBox.Show(Resources.DeleteItemActionQuestion, action.GetView().GetText(),
                                                         MessageBoxButton.YesNo, MessageBoxImage.Question,
                                                         MessageBoxResult.No) == MessageBoxResult.Yes))
            {
                action.RemoveItem(selectedItem);
            }
        }