Replies: 14 comments
-
You already can use css to customize your controls. Also xaml is based on xml, so it should have xml syntax |
Beta Was this translation helpful? Give feedback.
-
You're kind of comparing apples to oranges here. Based on your "Expect version 1" your first style should look like this: <Style x:Key="Btn" TargetType="Button">
<Setter Property="Width" Value="60" />
<Setter Property="Height" Value="32" />
<Setter Property="Background" Value="#4C5EE9" />
<Setter Property="Foreground" Value="#FFF" />
<Setter Property="BorderRadius" Value="3" />
</Style>
<Button Style="{StaticResource Btn}" Content="Button" /> Now that's not really that bad. (For what it's worth, it would be great if Of course, BorderRadius isn't a property of Button. But what I suspect you're doing is you're trying to say "Look at all the stuff you have to do to change a template" but then what you show as "expected" does not look like it could result in a changed template. So kind of not really comparing fairly. Again, apples to oranges. But for sure, when you do have to create a new Template, it gets very verbose. If you wanna propose something that would make it less so, I think you would need to show something that looks like it could actually create a template.
Also, I don't wanna exactly, you know, go all "language wars" or anything, but in my opinion: |
Beta Was this translation helpful? Give feedback.
-
Maybe you're right, but it would be nice if XAML opened up more property Settings, like rounded corners |
Beta Was this translation helpful? Give feedback.
-
Oh for sure. As of 17763, I should note, "CornerRadius" is a property that's available on all Controls, and can be used for rounding corners. I think there's definitely room for improvement in what Styles can do as well. I think a big pain point is that it's extraordinarily hard to style just one part of a template. Like either the control author creates a bunch of "Inner" style properties, or you have to remake the whole template. Also, just XML verbosity is a thing in general. So here's to hoping that at least some verbosity can be mitigated a little. |
Beta Was this translation helpful? Give feedback.
-
XAML just has too few properties available, hopefully more and more in the future, and I'm eager to give this UI framework a try |
Beta Was this translation helpful? Give feedback.
-
What do yo mean “too few properties”? |
Beta Was this translation helpful? Give feedback.
-
Some components have too few styles @VladislavAntonyuk |
Beta Was this translation helpful? Give feedback.
-
But it is not an issue of XAML and adding CSS as you suggested, won't add more. As for corner radius there were a discussion to create ICorner interface which will be applied to all controls that support rounded corners |
Beta Was this translation helpful? Give feedback.
-
I think you might need to go back and go over a few of the finer points on MAUI and Xamarin... One of the amazing parts about it is that nearly everything is extensible.... soooo if it doesn't have enough or the right bindings for you, boom add more and sub a pr on it... If it's solid and doesn't cause issue's then it will get incorporated into the base... And or I would take a look at css / xaml integrations and how they interact with each other... because there has been a long-standing prop on this that just never gained major traction in the community to make them a more linear feel. Furthermore, this MIGHT be the right time to revisit that or soon™ because of the roadmap of incorporation of bBlazor as a project type. But I will say that personally as a long-time Xamarin guy and it is the language of choice... If you are finding yourself doing ALOT of this stuff all over the place... you might need to think over a few things on page structure because unfortunately, the verbosity will not go away. I can think of a half dozen things that would go fubar lowering it, just due to the ways data binding's work.. |
Beta Was this translation helpful? Give feedback.
-
Yes, I wanted XAML to open up more styles to components to reduce the amount of code |
Beta Was this translation helpful? Give feedback.
-
And @JHeLiu rounded corners are suuuper cake... James Montemagno has a blog some were on them. And or you could just have elements x/y/z have rounded corners if you put together a layout/parody pack. See Visual = Material for some solid examples of layout/parody pack |
Beta Was this translation helpful? Give feedback.
-
You incorrectly understand what xaml does. It is just a markup language. All component properties created in behind as BindableProperty which than used to setup native components in Renderers |
Beta Was this translation helpful? Give feedback.
-
css and html are very Bad language!Because they are not rigorous |
Beta Was this translation helpful? Give feedback.
-
@xzbaijj Yes. |
Beta Was this translation helpful? Give feedback.
-
Make XAML style writing more like CSS
I don't know if future versions have that design in mind
Let's say I want a button with rounded corners
// version now
// expect version 1
// expect version 2
Beta Was this translation helpful? Give feedback.
All reactions