Ticket T1013358
Visible to All Users

IActionExecutorService internal

created 4 years ago

Hi Guys,

is there a reason IActionExecutorService is internal? i am trying to build some custom navigation dashbaord - where i generate a href links - and in the onclick event i execute the ShowNavigationItemAction -> for this i want the loading indicator to be shown - so i added the xaf-action css class - but to hide the loading indicator it seems i need to use the IActionExecutorService ?

Comments (2)
DevExpress Support Team 4 years ago

    Hi Martin,

    As far as I understand, you with to execute custom code when an Action in the Navigation Control is clicked (similar as you do with the SetClientScript method in XAF Web). Currently, XAF Blazor does not support this. I'll discuss this case with my team to check what solution we can suggest for now.

    Meanwhile, would you please send me a sample project to illustrate your task in action?

    M M
    Martin Praxmarer - DevExpress MVP 4 years ago

      Hi Gosha,

      no - i dont want to customize the Navigation Control. I try to build some kind of "quick navigation" dashboard - i have a custom razor component - where i generate a href links

      Snippet

      Code
      <a href="#" class="xaf-action" @onclick="() => ExecuteNavigationClick(item)" @onclick:preventDefault>                        <XafImage ImageName="@item.NavigationItem.ImageName" Size="48" CssClass="item-icon" />                        <div class="item-label">@item.NavigationItem.Caption</div>                    </a>

      the a href i have decorated with the xaf-action css class - so the loading indicator is automaticly shown. but in the ExecuteNavigationClick - i am executing the ShowNavigationItemAction - which should hide the loading indicator after it has executed. so far i found from source code that you use the # IActionExecutorService for this. i made a quick and dirty example - see attached - simply open an employee detailview to see the component!

      Answers approved by DevExpress Support

      created 4 years ago (modified a year ago)

      Thank you for the clarification, Martin. You can use the Release method of the ILoadingIndicatorProvider service to hide the loading panel. This service is public.

      C#
      @inject DevExpress.ExpressApp.Blazor.Services.ILoadingIndicatorProvider loadingIndicatorProvider; private void ExecuteNavigationClick(DemoModel item) { var blazorApplication = (BlazorApplication)this.Application; var controller = blazorApplication.MainWindow.GetController<ShowNavigationItemController>(); Action action = () => controller.ShowNavigationItemAction.DoExecute(controller.FindNavigationItemByViewShortcut(new ViewShortcut(item.NavigationItem.View.Id, null))); action.Invoke(); loadingIndicatorProvider.Release("Navigation Done"); }

      For more information about the loading panel, refer to the following help topic: Loading Panels / Splash Forms (ASP.NET Core Blazor).

        Comments (2)
        M M
        Martin Praxmarer - DevExpress MVP 4 years ago

          Thank you Gosha - after further studying the source code i already changed that today :) anyway - wouldnt it be cleaner to use the # IActionExecutorService for this - as it also handles exceptions for example?

          DevExpress Support Team 4 years ago

            Yes, using IActionExecutorService is more convenient in this case. I believe that we will also implement a public API for such tasks in the future.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.