Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I can set margins individually in code but how do I do it in XAML, e.g. how do I do this:

PSEUDO-CODE:

<StackPanel Margin.Top="{Binding TopMargin}">
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
126 views
Welcome To Ask or Share your Answers For Others

1 Answer

Isn't this what you're looking for?

<StackPanel Margin="0,10,0,0" />

The first value is Left margin, then Top, then Right, and last but not least Bottom.

I'm not sure if you want to bind it to something, but if not, that'll work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...