Example code is weird

https://blazor.syncfusion.com/demos/dashboard-layout/overview?_gl=1*1jzc5h3*_ga*ODAyOTE4Nzg3LjE3MDkzNjE5MTQ.*_ga_41J4HFMX1J*MTcwOTgyMjYxNS4xMy4wLjE3MDk4MjI2MTUuMC4wLjA.

I was trying to follow this demo code.

But

// can't find namespace

@using ThemeHelper

// not exist name in context

Theme = ThemeHelper.GetCurrentTheme(NavigationManager.Uri);

// SampleSerivce is missing

background-image: url("@(SampleService.WebAssetsPath + "images/dashboard-layout/food.png")");


ThemeHelper doesn't seem to be a member of Syncfusion Nuget Package

and SampleService class is missing.

Please advice me.


1 Reply

SA SureshRajan Alagarsamy Syncfusion Team March 8, 2024 01:23 PM UTC

Hi Lee,


Greetings from Syncfusion support.


We have reviewed your query and understand that you have concerns regarding our code in the Dashboard Layout component Sample Browser demo. We suggest you to follow the below details to get answer for your queries.


Query 1 : Regarding ThemeHelper.


We would like to inform you that internally, we utilize the ThemeHelper class to facilitate theme switching for the Dashboard Layout component in our sample browser demo, providing to user preferences.


If you intend to utilize a specific theme, we recommend referencing the theme in the App.razor file for your WebApp. You can find detailed instructions for both server and WASM applications in the following documentation links.


WebApp : https://blazor.syncfusion.com/documentation/file-manager/getting-started-with-web-app#add-stylesheet-and-script-resources


Server and WASM application : https://blazor.syncfusion.com/documentation/file-manager/getting-started#add-stylesheet-and-script-resources


Additionally we have attached available theme for your reference.


Documentation : https://blazor.syncfusion.com/documentation/appearance/themes


Query 2 : SampleService is missing.


Internally, we utilize the SampleService file and access the image path from it for the Dashboard Layout component. To resolve this issue, we recommend providing the corresponding path from which you wish to retrieve the image and assign it to the background-image property.


Check out the shared details and get back to us if you need any further assistance.


Regards,
Suresh.


Loader.
Up arrow icon