A few weeks ago, I first shared my idea for an alternative to writing XAML. However, I just realised I haven't posted about it here. So, I've included the TLDR below.
It might be tempting to think about it as simply a way to write XAML, but I think of it as more.
I think it's a way of documenting what you want from the UI in a way that encourages you to think about the markup as any other code file.
The idea came from ideas about how to address some of the common criticisms of XAML. There are ways to write XAML that address many of those issues, but the restrictions of the language mean that it's only possible to go so far. ENAMEL is an idea about what could be done without the historical baggage of XAML and without needing to change any of the tooling or existing code bases for languages that use XAML.
I'm still exploring ideas about what ENAMEL could be.
I'm also working on formalising my ideas and guidance for writing better XAML. Stay tuned for more details.
In the meantime:
ENAMEL - An RFC for possible future XAML-based development
A new, simplified markup language to define application UI. The new files automatically generate comparable XAML files for your WPF, .NET MAUI, or WinUI app, which are then compiled as normal. Fully configurable, totally optional (use it for some or all XAML files) and low risk as the XAML (and C#) files are still available.
It addresses the common complaints about having to work with XAML and adds new functionality without the need to change any of the existing tooling.
How much less verbose is it?
Well, this is the XAML for an Empty page in a .NET MAUI app.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="NewMauiApp.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
</ContentPage>
And this is the exact same thing in ENAMEL.
ContentPage
Yes, just a single word is needed!
There are more examples comparing XAML and ENAMEL.
ENAMEL: Simple, human-readable, and easily maintainable UI markup.
Learn more at https://github.com/mrlacey/enamel
I also have a few amendments and extensions to the original process that are coming soon.
0 comments:
Post a Comment
I get a lot of comment spam :( - moderation may take a while.