I want to increase current window height when click on button.
I use this code:
private void sendbtn_Click(object sender, RoutedEventArgs e) { DoubleAnimation myDoubleAnimation = new DoubleAnimation(); myDoubleAnimation.From = this.Height; myDoubleAnimation.To = 500; myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.5)); Storyboard myStoryboard = new Storyboard(); myStoryboard.Children.Add(myDoubleAnimation); Storyboard.SetTargetName(myDoubleAnimation, this.Name); Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(Window.HeightProperty)); myStoryboard.Begin(this); } but I want declare my storyboard in xaml and run it from code.
but I dont know how do this ??