C
C#6mo ago
Indeed

WPF with html-css alike framework?

Hi! I came back to make some apps for myself in wpf after working for a long time in frontend. and on god - i love the DI and MVVM architecture but I cannot stand XAML for the life of me. Is there something like wpf mvvm but with html and css? I know xamarin supports css, but html?
7 Replies
Doombox
Doombox6mo ago
Unfortunately not, MAUI can also use CSS but XAML underpins every .NET UI framework You could use something like Blazor frontend and then host it in Electron or something but that is beyond cursed XAML and HTML aren't a million miles from each other though, what about XAML is it that you hate?
Indeed
Indeed6mo ago
I'd say it's mostly due to it being a guess work for me and not as intuitive or declarative as html with js like syntax. for example itemsources vs item loops (today spent an hour looking how to append an item to the beginning of a listbox...)
You could use something like Blazor frontend and then host it in Electron or something but that is beyond cursed
In theory there is support for blazor + .net maui but we don't know how fast microsoft will kill it
Doombox
Doombox6mo ago
Very much seems like a "you" problem without wanting to be too blunt about it, if you're databinding then you shouldn't really care about the precise inner workings of a listbox and the majority of your behaviour will come from your ViewModels. I avoid web dev like the plague because I can't stand the JS framework nightmare, but HTML in itself is basically the same sort of idea as XAML so that bit is easy we also have CSS style selectors in Avalonia, but you'll still be doing all your styling in XAML, which is admittedly not the languages strong point ASP.NET MVC is another option if you're dead set on Html/Css, and that isn't going anywhere
Indeed
Indeed6mo ago
Very much seems like a "you" problem without wanting to be too blunt about it, if you're databinding then you shouldn't really care about the precise inner workings of a listbox and the majority of your behaviour will come from your ViewModels.
I agree and do not mind it. Like I said - i love C# and everything about it, but the XAML and I did have some questionable opinions and aversions in the past
I can't stand the JS framework nightmare
Same, especially since I love the DI way of work rather than module singletons
HTML in itself is basically the same sort of idea as XAML
Yes, but it has a lot more boilerplate around controls like e.g. grid having inbuild border as a separate element and so on i.e. one element in there being premade of other elements and only then there being inside my content
ASP.NET MVC is another option if you're dead set on Html/Css, and that isn't going anywhere
I'm mostly planning on doing some small utility apps for myself like rn. working on an app to pin a window to screen since all solutions I saw seemed dead set on on providing unnecessary features or paid plans Decided to give a go to the blazor + maui and seems to be fine for now especially since blazor has gotten strong typing and intellisense since i last saw it
Doombox
Doombox6mo ago
Blazor mainly sucks because of the performance more than anything else, I'm not sure how well it runs under MAUI the only other major downside is the horrendous payload bloat, but that's completely irrelevant on a desktop app
Angius
Angius6mo ago
Avalonia supports CSS-like selectors, fwiw
Doombox
Doombox6mo ago
Yup, mentioned that, one of the best things about Avalonia