WPF动画——故事板(Storyboard)

1、XAML代码

复制代码


    
        
    
    
        
            
                
                    
                    
                
            
        
    
    
        
        

复制代码

2、后台代码

复制代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace 故事板
{
    /// 
    /// MainWindow.xaml 的交互逻辑
    /// 
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }
    public class BtnHeightConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double width = 0;
            width = (double)value - 150;
            return width;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

}

复制代码

3、效果

WPF动画——故事板(Storyboard)_第1张图片

WPF动画——故事板(Storyboard)_第2张图片

 

 

 

WPF动画——故事板(Storyboard)_第3张图片

你可能感兴趣的:(C#,c#)