Replies: 11 comments
-
XAML is not flexible & powerful & clean as UIKit. |
Beta Was this translation helpful? Give feedback.
-
Comet - C# UI MVU |
Beta Was this translation helpful? Give feedback.
-
what is that? |
Beta Was this translation helpful? Give feedback.
-
This is what you need: https://github.com/dotnet/comet However, I didn't see any advantage of using those "flutter-like" patterns for UI development, which extremely couple the UI layout and code behind and make it hard for long-term maintenance as well as automatically UI tests. It benefits nothing except shortening the period of prototyping a demo app IMO. |
Beta Was this translation helpful? Give feedback.
-
Xaml is more flexible than the others, due to every control being built from a template that are built from primitive elements, and the visuals are entirely controlled by the framework. SwiftUI tightly controls the appearance of every UI element it supports. Beyond the elements/properties you can adjust, it takes extra effort to customise things. But it is easier to declare and build your UI in chunks that move around. Kotlin Jetpack is kind of the equivalent of WinUI by implementing new controls, and handling back compat outside of the system. MAUI will support C# Markup. From my limited understanding, this is an MVU pattern, and seems like the C# equivalent to SwiftUI
Is C# Markup and Comet the same thing? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
You can separate the UI code from the business logic - that is what partial classes can do for you. And Comet leans towards SwiftUI the more. You can develop large apps using MVU app model. Xaml is even hard to read talk of maintaining. |
Beta Was this translation helpful? Give feedback.
-
No, they are not the same thing - but the authors talk to each other about their ideas. C# Markup is more of mvvm app model oriented. While Comet is more of MVU app model oriented. See example of Comet - C# UI MVU below |
Beta Was this translation helpful? Give feedback.
-
@HppZ @saint4eva For me XAML is also not flexible, efficient and clean. I've created a library that creates a UI in WinUI 3 using fluent methods in C#. I based it on my earlier project which I created for MAUI. Unfortunately, the MAUI library is too slow for desktop projects, and has many gaps. This made me decide to create a version directly for WinUI 3. The whole thing was much, much faster than using MAUI and no need for XAML too. I made it for my projects, but decided to make it publicly available. Most code is generated using source generators. It covers all dependency properties and event handlers. If you have time to test it, I'm waiting for your feedback. https://github.com/idexus/CodeMarkup-WinUI Examplepublic partial class HomePage : Page
{
int count = 0;
public HomePage()
{
this.Resources = new()
{
new ThemeValue<Color> { Key = "HeaderColor", Light = Colors.Navy, Dark = Colors.Aqua }
};
this.VerticalAlignment = VerticalAlignment.Center;
Content = new StackPanel
{
new TextBlock()
.FontSize(45)
.Text("Code Markup for WinUI")
.TextAlignment(TextAlignment.Center)
.Foreground(e => e.ResourceKey("HeaderColor").Source(this)),
new TextBlock()
.FontSize(20)
.Text("Welcome to the Quick Samples Gallery")
.TextAlignment(TextAlignment.Center),
new Button()
.Content("Click me")
.Margin(0,35,0,15)
.FontSize(20)
.HorizontalAlignment(HorizontalAlignment.Center)
.OnClick(button =>
{
count++;
button.Content = $"Clicked {count} ";
button.Content += count == 1 ? "time" : "times";
})
};
}
} |
Beta Was this translation helpful? Give feedback.
-
This is amazing. Any quality attempt such as this to remove xaml is a welcome idea. I will check your repo. Thanks. |
Beta Was this translation helpful? Give feedback.
-
xaml is noisy |
Beta Was this translation helpful? Give feedback.
-
on their 'Design philosophy'
Beta Was this translation helpful? Give feedback.
All reactions