Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Blazor Starterkit Settings


The 3 settings in the themesettings.json file are not working properly.


"Direction": "ltr" <|> getDirection() || isRtlDirection()
"ModeSwitchEnabled": false <|> isModeSwitchEnabled()
"ModeDefault": "dark" <|> getModeDefault()




Screenshots:



But does work in _Master.cshtml work.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (8)


Hi,

API function should be working in _Master.cshtml as well.
I guess the problem is in your alert value, try to pass elements as a single string value.

<script>
alert("@KTTheme.isModeSwitchEnabled() - @KTTheme.getModeDefault() - @KTTheme.getDirection()");
</script>


Regards,
Lauris Stepanovs,
Keenthemes Support Team



It's already working fine in the _Master.cshtml file.
The main problem is that it doesn't work properly with other files.



Hi,

This still works fine and displays values in the navbar. Please make sure that you are updating the correct file, we have two navbar components SidebarLayout/Header/_Navbar.razor and HeaderLayout/Header/_Navbar.razor, the first file is used in sidebar layouts and a second in header layouts.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



If you open the images I uploaded in a new tab, you will notice that the code works but works incorrectly.

Due to the theme, half of my images are visible while half are not. You should look at the picture in full size.





While the result should be rtl dark False, the result is ltr light True.

If you still do not understand the basic problem, I will make a video.



Hi,

We rechecked an issue and found that the class instance injected into a partials folder differs from the class which was initialized, it is due to a KTTheme dependency scope.

We will include a fix for this issue in the next Metronic release, to fix this now you can follow the instructions below.


  1. In file blazor/Starterkit/Program.cs. Change scope functions from AddScoped to AddSingleton on 12 and 13 lines

    builder.Services.AddScoped<IKTTheme, KTTheme>();
    builder.Services.AddScoped<IBootstrapBase, BootstrapBase>();


  2. Changes above will cause an error An item with the same key has already been added. to fix this error update line 25 in file Starterkit/_keenthemes/libs/KTTheme.cs with the code below.

    attribute[attributeName] = attributeValue;




Regards,
Lauris Stepanovs,
Keenthemes Support Team

Thx for helping.



Glad to hear that it helped you. All the best with your project!

Regards,
Lauris Stepanovs,
Keenthemes Support Team


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(