Page 1 of 1

How to use bootstrap (or uikit)?

Posted: Fri Jan 06, 2017 2:05 am
by tomny
Dear JS-Support:

How to use bootstrap (or uikit)?

I tried to bootstrap-wpf-style (https://github.com/ptddqr/bootstrap-wpf-style) to Cshtml5, but unsuccessful. Because cshtml5 some styles do not support.

But I changed to think, cshtml5 create html5 application, should be able to directly use bootstrap, it should not need to be converted to xaml. But I did not find a way to set CssClass?

In addition, the other style library uikit (https://getuikit.com/) is also very good, it also includes a lot of web components. These components can be easily used in cshtml5 inside? Thank you!

Regards,
Tomny

Re: How to use bootstrap (or uikit)?

Posted: Mon Jan 09, 2017 5:09 am
by JS-Support @Userware
Dear Tomny,

The recommended way to style your controls is to use XAML styles and templates. You can read more about them at:

http://cshtml5.com/links/styles-and-templates.aspx

If really want to use CSS styles, you can do so by using the method "Interop.LoadCssFile", documented at:
http://cshtml5.com/links/how-to-call-javascript.aspx#LoadCssFile

in conjunction with the new "HtmlPresenter" control (introduced in Beta 10.5 and newer) which lets you embed arbitrary HTML code in your XAML by setting the property "HtmlPresenter.Html = ...".

Regards,
JS-Support