实现效果如下:
思路:基本原理同博文WPF实现聚光灯动画效果一致,难点在与正弦曲线的绘制和动态效果。
步骤:
1、自定义控件MyLoadingControl的封装
添加自定义Value属性:
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(int), typeof(MyLoadingControl), new PropertyMetadata(null));
public int Value
{
get { return (int)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
}
xaml布局:
<Grid x:Name="mainGrid">
<TextBlock Text=