YourScroller.Margin = new Thickness(0,0,0,90);
On your button click
Question
I have a scrollviewer with a standard margin(0,0,0,0). If I click on the button the margin for the scrollviewer needs to be margin(0,0,0,90). How can I do this in the code?
Solution
YourScroller.Margin = new Thickness(0,0,0,90);
On your button click
OTHER TIPS
I assume mainscrollviewer is your scrollviewer x:name
//Button click
private void ButtonClick_Click_1(object sender, RoutedEventArgs e)
{
mainscrollviewer.Margin = new Thickness(0, 0, 0, 90);
}
On your button click set it programatically:
ScrollViewer.Margin = new System.Windows.Thickness(0, 0, 0, 90);