EdgeInsets Markup Extension #168
Closed
tuyen-vuduc
started this conversation in
New Feature Discussions
Replies: 1 comment
-
Closed as per the Community Stand-up discussion here: https://youtu.be/N9wMcBP4jtg?t=2889 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
I did create and use
EdgetInsetsMarkupExtension
for my project. I think you might also like it.What it can do
This extension helps us to define our margin/padding in a clean, meaning way. The idea comes from Flutter's EdgeInsets.
I already created a PR to XamarinCommunityToolkit library as you can find here.
I used it in my sample TodoApp project as well.
How to use it
==>
==>
==>
We can create more combinations from properties provided. The priority will be
Top
,Left
,Right
,Bottom
Horizontal
,Vertical
All
In case no value is specified, Zero will be assigned to a particular edge.
Why it benefits you?
x:Static
orx:StaticResource
to reference to itRegarding the last point, normally, I define these kinds of spacing: large, medium, small, xlarge, xsmall.
If we go the old way, and we want to reuse those values, we have to define a lot of combinations because we couldn't define
However, with my extensions, we don't have to define all combinations, we just use the value when it's really should be.
Please share your thoughts if I should create a PR to this repo.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions