Ticket T1112635
Visible to All Users

Re: Blazor - How to show a fully custom non-XAF web form (with custom controls, JavaScript, Razor components, etc.)

created 3 years ago

Hi,
I used the solution from the ticket: "Blazor - How to show a fully custom non-XAF web form (with custom controls, JavaScript, Razor components, etc.)" to create a razor-component.

I created a custom page named: custompage.razor with following content:

Razor
@page "/custom" <h3>Custompage</h3> @code { }

I can see it using the direct way with https://localhost:44318/custom

After that I created a NavigationItem with the Id "CustomPageItem"

My goal is to show the blazor-compontent after clicking on the nav-item, but don't lose the general layout like navbar, theme,…

But with following code I only see the custompage.razor content and nothing from the xaf template:

C#
public class CustomItemPageController : WindowController { public CustomItemPageController() { TargetWindowType = WindowType.Main; } protected override void OnActivated() { base.OnActivated(); ShowNavigationItemController showNavigationItemController = Frame.GetController<ShowNavigationItemController>(); showNavigationItemController.CustomShowNavigationItem += showNavigationItemController_CustomShowNavigationItem; } void showNavigationItemController_CustomShowNavigationItem(object sender, CustomShowNavigationItemEventArgs e) { if (e.ActionArguments.SelectedChoiceActionItem.Id == "CustomPageItem") { var navigationManager = ((BlazorApplication)Application).ServiceProvider.GetRequiredService<NavigationManager>(); navigationManager.NavigateTo("/custom", forceLoad: true); } } }

Is there a way to show the page only as part of the xaf project - I couldnt find any resource for this problem. The only thing I found was should devExtreme components in xaf.

PS: I attached a screenshot before I click the navitem and after where I lost the navbar.

Kind regards

Comments (1)

    Hi,
    I partly solved the problem following: https://supportcenter.devexpress.com/ticket/details/t943982 and ignoring the Grid parts.

    So I have a page showing the blazor-component, but know I have the problem, that I don't know how to remove the default controls for the dashboard (Organize Dashboard and Refresh) - I would like to have a blank view with minimal setup.
    Clipboard-File-1.png
    Thx for your support

    Answers approved by DevExpress Support

    created 3 years ago

    Hello,

    XAF has multiple ways to hide actions: Ways to Hide or Disable an Action. I updated our ticket to describe solutions that are most suitable for this case: Blazor - How to show a fully custom non-XAF web form (with custom controls, JavaScript, Razor components, etc.).

      Comments (2)

        Thx, perfect answer. Your links are on the point

        Anatol (DevExpress) 3 years ago

          You are welcome!

          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.