how to dynamically change marign value wpf code example Example: set margin programmatically wpf c# test.Margin = new Thickness(0, -5, 0, 0);