The form has a Grid (which goes beyond the form) and a button.
Question: how can I move the Grid in the direction I need (for example, to the left) by a certain number in Margin each time I press a button?
Ie the button was pressed, the value was added to the Grid, for example 50 to margin left, I pressed it once more, the same number was added
marginLeftproperty inVM, bindMarginto this property. create a team that will increase this property. - Gardesprivate void right_Click(object sender, RoutedEventArgs e) { Thickness margin = Block_1.Margin; this.Block_1.BeginAnimation(FrameworkElement.MarginProperty, new ThicknessAnimation(new Thickness(margin.Left = 50), TimeSpan.FromSeconds(0.10))); }lot, here’s the button code:private void right_Click(object sender, RoutedEventArgs e) { Thickness margin = Block_1.Margin; this.Block_1.BeginAnimation(FrameworkElement.MarginProperty, new ThicknessAnimation(new Thickness(margin.Left = 50), TimeSpan.FromSeconds(0.10))); }private void right_Click(object sender, RoutedEventArgs e) { Thickness margin = Block_1.Margin; this.Block_1.BeginAnimation(FrameworkElement.MarginProperty, new ThicknessAnimation(new Thickness(margin.Left = 50), TimeSpan.FromSeconds(0.10))); }private void right_Click(object sender, RoutedEventArgs e) { Thickness margin = Block_1.Margin; this.Block_1.BeginAnimation(FrameworkElement.MarginProperty, new ThicknessAnimation(new Thickness(margin.Left = 50), TimeSpan.FromSeconds(0.10))); }but it does not work correctly and does not add a margin .. - Elizabeth